0

I get an SSLPeerUnverifiedException after switching from HTTP to HTTPS which I don't understand since the wildcard certificate should work for the URL.

javax.net.ssl.SSLPeerUnverifiedException: Certificate for <abc.lan.corp.com> doesn't match any of the subject alternative names: [*.lan.corp.com]
 at org.apache.http.conn.ssl.SSLConnectionSocketFactory.verifyHostname(SSLConnectionSocketFactory.java:507)
 at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:437)
 at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:384)
 at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
 at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:374)
 at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393)
 at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
 at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
 at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
 at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
 at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
 at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
 at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
 at lan.corp.com.sapconnector.client.SAPDownloader.download(SAPDownloader.java:31)
 at lan.corp.com.sapconnector.client.download.DownloadClient.getSAPInformation(DownloadClient.java:62)
 at lan.corp.com.sapconnector.client.download.DownloadClient.executeDelegate(DownloadClient.java:33)
 at lan.corp.com.sapconnector.client.AbstractClient.execute(AbstractClient.java:23)
 at lan.corp.com.sapconnector.SapSyncMixin.lambda$4(SapSyncMixin.java:93)
 at lan.corp.com.sapconnector.SapSyncMixin$$Lambda$32/0x0000000000000000.apply(Unknown Source)
 at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
 at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
 at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
 at java.util.Iterator.forEachRemaining(Iterator.java:116)
 at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
 at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:497)
 at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:487)
 at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
 at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:241)
 at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566)
 at org.jooq.lambda.SeqImpl.collect(SeqImpl.java:190)
 at org.jooq.lambda.Seq.toList(Seq.java:9194)
 at org.jooq.lambda.SeqImpl.toList(SeqImpl.java:558)
 at lan.corp.com.sapconnector.SapSyncMixin.runSync(SapSyncMixin.java:99)
 at lan.corp.com.sapconnector.SapSyncMixin$$Lambda$5/0x0000000000000000.accept(Unknown Source)
 at java.util.Optional.ifPresent(Optional.java:159)
 at lan.corp.com.sapconnector.SapSyncMixin.runSync(SapSyncMixin.java:61)
 at lan.corp.com.sapconnector.SapSyncMixin.runSync(SapSyncMixin.java:54)
 at org.corp.com.domino.abrechnungs.agent.SapSyncAgentBase.NotesMain(SapSyncAgentBase.java:15)
 at lotus.domino.AgentBase.runNotes(Unknown Source)
 at lotus.domino.NotesThread.run(Unknown Source)

The used Java runtime version is 1.8.0_302-b08 and the failing https request is made with Apache HTTP client 4.5.9

Accessing the same server with Google Chrome reports the certificate as valid with same URL.

Any ideas?

5
  • Posting the stack trace would allow us to see if the certificate checking code belongs to JRE or to Apache htpclient. Commented Nov 21, 2024 at 8:47
  • Please post a complete HttpClient wire / context log of the session and I will take a look hc.apache.org/httpcomponents-client-5.4.x/logging.html Commented Nov 22, 2024 at 8:10
  • @Robert stack trace added to my question Commented Nov 27, 2024 at 7:36
  • 1
    Upgrade to Apache HttpClient 4.5.14 or 5.4.1 Commented Nov 27, 2024 at 8:24
  • 1
    This is a known problem and should be fixed in 4.5.12 or newer see issues.apache.org/jira/browse/HTTPCLIENT-2047 and issues.apache.org/jira/browse/HTTPCLIENT-2055 Commented Nov 27, 2024 at 9:08

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.