Skip to content

Instantly share code, notes, and snippets.

@rintcius
Created November 6, 2012 20:34
Show Gist options
  • Select an option

  • Save rintcius/4027346 to your computer and use it in GitHub Desktop.

Select an option

Save rintcius/4027346 to your computer and use it in GitHub Desktop.
Container of SSL problems that can occur; possible causes and solutions
Possible causes:
- Truststore not found
- Truststore does not contain the required entry (correctly).
The java library io-webservices-api communicates with https://api.webservices.io and requires a valid public key with this domain in its truststore.
Possible solution:
- Add entry to truststore. See http://webservices.io/ssl
Associated stacktrace:
Exception in thread "main" org.springframework.web.client.ResourceAccessException: I/O error: peer not authenticated; nested exception is javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:461)
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:409)
at org.springframework.web.client.RestTemplate.postForObject(RestTemplate.java:287)
at io.webservices.api.document.DocumentConverterClient.convert(DocumentConverterClient.java:55)
at io.webservices.api.document.DocumentConverterDemo.main(DocumentConverterDemo.java:59)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
at com.sun.net.ssl.internal.ssl.SSLSessionImpl.getPeerCertificates(SSLSessionImpl.java:352)
at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:128)
at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:572)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:151)
at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:125)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:640)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:479)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
at org.springframework.http.client.HttpComponentsClientHttpRequest.executeInternal(HttpComponentsClientHttpRequest.java:88)
at org.springframework.http.client.AbstractBufferingClientHttpRequest.executeInternal(AbstractBufferingClientHttpRequest.java:46)
at org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:49)
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:446)
... 9 more
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment