我想使用自定义ssl,所以我添加了一个带有以下文件的.jar(commons-httpclient-contrib.jar
):
META-INF / MANIFEST.MF org.apache.commons.httpclient.contrib.ssl.EasySSLProtocolSocketFactory.class org.apache.commons.httpclient.contrib.ssl.EasyX509TrustManager.class org.apache.commons.httpclient.contrib.ssl.StrictSSLProtocolSocketFactory.class org.apache.commons.httpclient.contrib.utils.HttpMethodCloner.class
Protocol.registerProtocol("https", new Protocol("https", new MySSLSocketFactory(), 443));
HttpClient httpclient = new HttpClient();
GetMethod httpget = new GetMethod("https://www.whatever.com/");
try {
httpclient.executeMethod(httpget);
System.out.println(httpget.getStatusLine());
} finally {
httpget.releaseConnection();
}
我正在尝试将上面的代码转换为scala。但我没有成功,并且有编译错误。