Method to store X509 certificate from Database
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
0
down vote
favorite
I've a method that gets certificate as BLOB and password as char
from Oracle Database, store this certificate x509, trust it, get the secure connection and verify Hostname.
This is the code:
public void openCert() throws Exception CertificateException e)
this.Message = "Err.openCert: ";
throw new Exception(this.Message + e);
catch (SQLException e)
this.Message = "Err.openCert.getCert["+line+"]: ";
throw new Exception(this.Message + e);
catch (Exception e)
this.Message = "Err.openCert.UncaughtException: ";
throw new Exception(this.Message + e);
finally
if(conn != null)
conn.close();
Do you have any idea to how improve the code and refactor it?
java sql oracle ssl
migrated from stackoverflow.com May 15 at 20:58
This question came from our site for professional and enthusiast programmers.
add a comment |Â
up vote
0
down vote
favorite
I've a method that gets certificate as BLOB and password as char
from Oracle Database, store this certificate x509, trust it, get the secure connection and verify Hostname.
This is the code:
public void openCert() throws Exception CertificateException e)
this.Message = "Err.openCert: ";
throw new Exception(this.Message + e);
catch (SQLException e)
this.Message = "Err.openCert.getCert["+line+"]: ";
throw new Exception(this.Message + e);
catch (Exception e)
this.Message = "Err.openCert.UncaughtException: ";
throw new Exception(this.Message + e);
finally
if(conn != null)
conn.close();
Do you have any idea to how improve the code and refactor it?
java sql oracle ssl
migrated from stackoverflow.com May 15 at 20:58
This question came from our site for professional and enthusiast programmers.
There is no key pair here, ergo no keystore either, only a truststore. You aren't checking the value ofresultSet.next()
. Off topic.
â user207421
May 14 at 16:34
What is aConexion
?
â 200_success
May 15 at 22:38
Conexión is a class that extends Connection and do more things, works like Connetion class and take DB connection from a .properties.
â Rancio
May 16 at 5:45
I don't get what the use of theHostnameVerifier
empty if statement is..Seems broken code?
â RobAu
May 17 at 8:30
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I've a method that gets certificate as BLOB and password as char
from Oracle Database, store this certificate x509, trust it, get the secure connection and verify Hostname.
This is the code:
public void openCert() throws Exception CertificateException e)
this.Message = "Err.openCert: ";
throw new Exception(this.Message + e);
catch (SQLException e)
this.Message = "Err.openCert.getCert["+line+"]: ";
throw new Exception(this.Message + e);
catch (Exception e)
this.Message = "Err.openCert.UncaughtException: ";
throw new Exception(this.Message + e);
finally
if(conn != null)
conn.close();
Do you have any idea to how improve the code and refactor it?
java sql oracle ssl
I've a method that gets certificate as BLOB and password as char
from Oracle Database, store this certificate x509, trust it, get the secure connection and verify Hostname.
This is the code:
public void openCert() throws Exception CertificateException e)
this.Message = "Err.openCert: ";
throw new Exception(this.Message + e);
catch (SQLException e)
this.Message = "Err.openCert.getCert["+line+"]: ";
throw new Exception(this.Message + e);
catch (Exception e)
this.Message = "Err.openCert.UncaughtException: ";
throw new Exception(this.Message + e);
finally
if(conn != null)
conn.close();
Do you have any idea to how improve the code and refactor it?
java sql oracle ssl
edited May 15 at 22:38
200_success
123k14143399
123k14143399
asked May 14 at 16:28
Rancio
1
1
migrated from stackoverflow.com May 15 at 20:58
This question came from our site for professional and enthusiast programmers.
migrated from stackoverflow.com May 15 at 20:58
This question came from our site for professional and enthusiast programmers.
There is no key pair here, ergo no keystore either, only a truststore. You aren't checking the value ofresultSet.next()
. Off topic.
â user207421
May 14 at 16:34
What is aConexion
?
â 200_success
May 15 at 22:38
Conexión is a class that extends Connection and do more things, works like Connetion class and take DB connection from a .properties.
â Rancio
May 16 at 5:45
I don't get what the use of theHostnameVerifier
empty if statement is..Seems broken code?
â RobAu
May 17 at 8:30
add a comment |Â
There is no key pair here, ergo no keystore either, only a truststore. You aren't checking the value ofresultSet.next()
. Off topic.
â user207421
May 14 at 16:34
What is aConexion
?
â 200_success
May 15 at 22:38
Conexión is a class that extends Connection and do more things, works like Connetion class and take DB connection from a .properties.
â Rancio
May 16 at 5:45
I don't get what the use of theHostnameVerifier
empty if statement is..Seems broken code?
â RobAu
May 17 at 8:30
There is no key pair here, ergo no keystore either, only a truststore. You aren't checking the value of
resultSet.next()
. Off topic.â user207421
May 14 at 16:34
There is no key pair here, ergo no keystore either, only a truststore. You aren't checking the value of
resultSet.next()
. Off topic.â user207421
May 14 at 16:34
What is a
Conexion
?â 200_success
May 15 at 22:38
What is a
Conexion
?â 200_success
May 15 at 22:38
Conexión is a class that extends Connection and do more things, works like Connetion class and take DB connection from a .properties.
â Rancio
May 16 at 5:45
Conexión is a class that extends Connection and do more things, works like Connetion class and take DB connection from a .properties.
â Rancio
May 16 at 5:45
I don't get what the use of the
HostnameVerifier
empty if statement is..Seems broken code?â RobAu
May 17 at 8:30
I don't get what the use of the
HostnameVerifier
empty if statement is..Seems broken code?â RobAu
May 17 at 8:30
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f194494%2fmethod-to-store-x509-certificate-from-database%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
There is no key pair here, ergo no keystore either, only a truststore. You aren't checking the value of
resultSet.next()
. Off topic.â user207421
May 14 at 16:34
What is a
Conexion
?â 200_success
May 15 at 22:38
Conexión is a class that extends Connection and do more things, works like Connetion class and take DB connection from a .properties.
â Rancio
May 16 at 5:45
I don't get what the use of the
HostnameVerifier
empty if statement is..Seems broken code?â RobAu
May 17 at 8:30