Skip to content

Commit

Permalink
Adding exception for certificates
Browse files Browse the repository at this point in the history
  • Loading branch information
mschaab-SA committed Nov 12, 2024
1 parent e566e80 commit 10b3ff5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.security.cert.CertificateException;
import java.util.Optional;

import javax.net.ssl.*;
Expand Down Expand Up @@ -154,7 +155,7 @@ private void createConnection() throws SARestAPIException {
.build();
client.property(ClientProperties.CONNECT_TIMEOUT, this.idpApiTimeout);
client.property(ClientProperties.READ_TIMEOUT, this.idpApiTimeout);
} catch (NoSuchAlgorithmException | KeyManagementException | KeyStoreException e) {
} catch (NoSuchAlgorithmException | KeyManagementException | KeyStoreException | CertificateException e) {
logger.error("Exception occurred while attempting to associating our SSL cert to the session: "
+ e.getMessage());
throw new SARestAPIException("Unable to create connection object, creation attempt returned NULL.", e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ private SATrustManagerFactory(){}

private static final String PKIX_ALGORITHM = "PKIX";

public static TrustManager[] createTrustsManagersFor(SABaseURL saBaseURL) throws NoSuchAlgorithmException, KeyStoreException {
public static TrustManager[] createTrustsManagersFor(SABaseURL saBaseURL) throws NoSuchAlgorithmException, KeyStoreException, CertificateException {
if( saBaseURL.isSelfSigned() ) {
// disabled impl.
return new TrustManager[]{
Expand Down

0 comments on commit 10b3ff5

Please sign in to comment.