• Register
0 votes
124 views

Problem : 

I have a Java web service client, which consumes a web service via HTTPS.
When I connect to the service URL, I get the exception 
java.security.cert.CertificateException: No subject alternative names present.
6 5 3
6,930 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

I have also faced the same issue and resolved it with bellow code.One must put this code before the first call to webservices.

javax.net.ssl.HttpsURLConnection.setDefaultHostnameVerifier(
new javax.net.ssl.HostnameVerifier()
{
public boolean verify(String hostname,
javax.net.ssl.SSLSession sslSession) 
{
return hostname.equals("localhost");
    }
}
);

Further Readings:

https://www.ibm.com/support/knowledgecenter/en/SS9J9E/ioc/ts_liberty_ip.html

9 7 4
38,600 points

Related questions

0 votes
1 answer 52 views
52 views
Problem : I have the Java web service client, which consumes the web service via HTTPS. When I try to connect to the service URL (https://AAA.BBB.CCC.DDD:9443/ISomeService ), I get the exception as below: “ Java.security.cert.CertificateException: No subject alternative names present.”
asked Jan 21, 2020 jwilliam 3.9k points
0 votes
2 answers 247 views
247 views
Problem : I am getting bellow error while using keytool keytool error: java.lang.exception: public keys in reply and keystore don't match
asked Oct 19, 2019 peterlaw 6.9k points
0 votes
2 answers 318 views
318 views
Problem : I am trying to consume a RESTful service from url https://someurl.com. But I am getting the following error: java security cert certpathvalidatorexception certificate chaining error
asked Oct 23, 2019 peterlaw 6.9k points
0 votes
1 answer 364 views
364 views
Problem : I have a java complied package and it is sopposed to communicate with https server on net. But when i try running the compilation gives the following exception: javax.net.ssl.sslexception: unrecognized ssl message, plaintext connection?
asked Oct 23, 2019 peterlaw 6.9k points
0 votes
1 answer 154 views
154 views
Problem : I can push by clone project using ssh but it is not working for me getting following error server certificate verification failed. cafile: /etc/ssl/certs/ca-certificates.crt crlfile: none
asked Nov 12, 2019 peterlaw 6.9k points
0 votes
1 answer 57 views
57 views
Problem : I guess Chrome have released an update over the past week. And this update has caused at least 100 of our internal applications to throw the exception shown below. The solutions I have found over the Internet, talk about updating the ... there anyone who is aware of a similar fix in Chrome? Error Server has a weak ephemeral Diffie-Hellman public key ERR_SSL_WEAK_SERVER_EPHEMERAL_DH_KEY
asked Nov 25, 2019 alecxe 7.5k points
1 vote
1 answer 15 views
15 views
I am trying to open an https URL using the urlopen method in Python 3's urllib.request module. It seems to work fine, but the documentation warns that "[i]f neither cafile nor capath is specified, an HTTPS request will not do any verification of the server’s ... get this list from? Is there any simple and cross-platform way to use the same list of certificates that my OS or browser uses?
asked Sep 13, 2020 Marivoke 530 points
0 votes
1 answer 42 views
42 views
Problem: I am trying to consume a PHP webservice which has the SSL certificate. I have the .net 3.5 Class library it references the webservice with a 'Add Service references' in Visualstudio 2010 If I try calling the main method of my webservice then I ... SslPolicyErrors sslPolicyErrors) { return true; } But somehow it is not working. Also I have already a certificate installed on my own pc.
asked Aug 12, 2020 Raphael Pacheco 4.9k points
1 vote
1 answer 72 views
72 views
Problem : I want to retrieve some of the information from the ABB G13 gateway that offer the RESTful JSON API. API is hosted by a gateway via the https endpoint. Basic authentication mechanism is used for the authentication. However all the traffic goes through ... line 522, in send raise SSLError(e, request=request) requests.exceptions.SSLError: EOF occurred in violation of protocol (_ssl.c:680)
asked Jan 2, 2020 alecxe 7.5k points