【发布时间】:2015-09-07 09:23:04
【问题描述】:
我在 IBM websphere 中使用由“https://demo.docusign.net”提供的 Docusign Rest API 时遇到 ssl 认证错误。我下载'演示 ssl 证书并从https://trust.docusign.com/certificates添加
I am using api like this....
Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("......", 81));
AuthenticateRequest authReq = null;
if(appConfiguration == null)
authReq = new AuthenticateRequest(configuration);
else
authReq = new AuthenticateRequest(configuration,appConfiguration);
System.out.println(url);
logger.debug("url : "+url);
logger.debug("Request : "+authReq.toJSONString());
HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection(proxy);
connection.setRequestMethod("GET");
connection.setRequestProperty(DOCU_SIGN_AUTH, authReq.toJSONString());
connection.setRequestProperty(ACCEPT, CONTENT_TYPE_VALUE);
connection.setRequestProperty(CONTENT_TYPE, CONTENT_TYPE_VALUE);
if(connection.getResponseCode()==HttpStatus.SC_OK || connection.getResponseCode() == HttpStatus.SC_CREATED) {
String response = getResponse(connection);
connection.disconnect();
return response;
}
****Error found....****
SSLSocketFactory is null. This can occur if javax.net.ssl.SSLSocketFactory.getDefault() is called to create a socket and javax.net.ssl.* properties are not set.
【问题讨论】: