使用HttpClient携带证书报错_Certificate for <IP> doesn't match any of the subject alternative names:[域名]
2017-10-13 10:46
861 查看
使用HttpClient携带pfx证书通过Https协议发送SOUP报文调用WebService接口时报如下错误:
问题分析:
颁发的证书是给制定域名的而非IP地址,因为服务器没有加入Public DNS,所以域名无法访问,我在调用接口时直接使用了IP地址,而不是域名。
问题解决:
在hosts配置文件中添加IP地址和域名的映射记录,在调用接口时使用域名进行调用,发现问题解决。
Exception in thread "main" javax.net.ssl.SSLPeerUnverifiedException: Certificate for <IP地址> doesn't match any of the subject alternative names: [域名] at org.apache.http.conn.ssl.SSLConnectionSocketFactory.verifyHostname(SSLConnectionSocketFactory.java:467) at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:397) at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:355) at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142) at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:359) at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:381) at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:237) at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185) at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89) at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:111) 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 vodafone.KeystoreUtil.main(KeystoreUtil.java:76)
问题分析:
颁发的证书是给制定域名的而非IP地址,因为服务器没有加入Public DNS,所以域名无法访问,我在调用接口时直接使用了IP地址,而不是域名。
问题解决:
在hosts配置文件中添加IP地址和域名的映射记录,在调用接口时使用域名进行调用,发现问题解决。
相关文章推荐
- Visual Studio使用"go to definition"出现"A definition for the symbol '<symbolName>' could not be located
- XCode编译iphone时出现的问题:The identity 'iPhone Developer' doesn't match any valid certificate/private key
- 解决“could not find gem 'turn <>=0 ' in any of the gem sources listed in your gemfile”错误
- SSIS: row skipped for <none> for the TextQualifier of flat file connection
- XCode编译出现的问题:The identity 'iPhone Developer' doesn't match any valid certificate/private key
- The entity type <type> is not part of the model for the current context
- XCode编译iphone时出现的问题:The identity 'iPhone Developer' doesn't match any valid certificate/private key
- BEA-290074 <Deployment service servlet received file download request for file "security/SerializedSystemIni.dat". The file may exist, but download of this file is not allowed.>
- [Cassandra] Mutation of <x> bytes is too large for the maxiumum size of <y>
- 关于Xcode编译ios程序时出现的错误:The identity 'iPhone Developer' doesn't match any valid certificate/private key
- code sign error doesn't match any valid certificate private key pair in the default keych 错误的解决办法
- The identity 'iPhone Developer: XXX doesn't match any valid certificate/private key
- The entity type <type> is not part of the model for the current context
- 关于Code Sign error:The identity 'iPhone distribution' doesn't match any valid certificate private ..
- Code Sign error: The identity 'Mac Developer' doesn't match any valid, non-expired certificate/priva
- <转>Change the Background of a selected ListBox Item
- Siebel Exception: The value entered in field Business Component of buscomp Repository WF Step does not match any value in the bo
- The tag of<o:p> and the <?xml:namespace prefix = o /> in the html
- Any chance of getting rid of the all_load requirement for the iOS framework?
- Siebel Exception: The value entered in field Business Component of buscomp Repository WF Step does not match any value in the bo