说明
解决kettle-8.3请求https时要校验ssl证书问题的httpclient-4.5.3.jar
如果不想自己修改源码的话,直接下载下面的包替换kettle/lib中的即可。
https://gitee.com/joshho/some-file/blob/master/httpclient-4.5.3.jar
httpclient源码地址
https://archive.apache.org/dist/httpcomponents/
源码修改说明
1、修改org.apache.http.conn.ssl.AbstractVerifier.java
类,修改后如下。
public final void verify(String host, SSLSocket ssl) throws IOException
{
Args.notNull(host, "Host");
}
public final boolean verify(String host, SSLSession session)
{
return true;
}
public final void verify(String host, X509Certificate cert)
throws SSLException
{}
2、修改org.apache.http.conn.ssl.DefaultHostnameVerifier.java
类,修改后如下。
public boolean verify(String host, SSLSession session)
{
return true;
}
public void verify(String host, X509Certificate cert) throws SSLException
{}
static void matchCN(String host, String cn, PublicSuffixMatcher publicSuffixMatcher)
throws SSLException
{}
3、如果是httpclient-4.5.4,还需要修改工程根目录下的pom文件中的编译级别,修改后如下。
<!-- 修改之前,下面两个都是1.6-->
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
编译命令
mvn clean install -Dcheckstyle.skip=true -DskipTests -Dencoding=utf-8 --settings=C:\Users\admin\.m2\settings-ali.xml
上面的settings文件换成自己的路径。
如果是使用IDEA执行install,则-Dcheckstyle.skip=true
参数的配置位置为:File | Settings | Build, Execution, Deployment | Build Tools | Maven | Runner
。
将-Dcheckstyle.skip=true
填入VM Options
输入框中。
参考资料
https://blog.youkuaiyun.com/u013171471/article/details/128654161