腾讯云 k8s java 程序参数配置 解决: 在腾讯云 pod 界面 按行分开 如 -Xmx1024m -Xms512m -Duser.timezone=GMT+8 -Djava.security.egd=file:/dev/./urandom -jar /app/my.jar --server.port=80 1234567 -Xmx1024m-Xms512m-Duser.timezone=GMT+8-Djava.security.egd=file:/dev/./urandom-jar/app/my.jar--server.port=80 … Read More
apache client https 禁止证书检测 解决: /** * 绕过验证 * * @return * @throws NoSuchAlgorithmException * @throws KeyManagementException */ static SSLContext createIgnoreVerifySSL() throws NoSuchAlgorithmException, KeyManagementException { SSLContext sc = SSLContext.getInstance("SSLv3"); // 实现一个X509TrustManager接口,用于绕过验证,不用修改里面的方法 X509TrustManager trustManager = new X509TrustManager() { @Override public void checkClientTrusted( java.security.cert.X509Certificate[] paramArrayOfX509Certificate, String paramString) throws CertificateException { } @Override public void checkServerTrusted( java.security.cert.X509Certificate[] paramArrayOfX509Certificate, String paramString) throws CertificateException { } @Override public java.security.cert.X509Certificate[] getAcceptedIssuers() { return null; } }; sc.init(null, new TrustManager[]{trustManager}, null); return sc; } public static CloseableHttpClient ignoreSSLClient() throws KeyManagementException, NoSuchAlgorithmException { //采用绕过验证的方式处理https请求 SSLContext sslcontext = HttpUtils.createIgnoreVerifySSL(); //设置协议http和https对应的处理socket链接工厂的对象 Registry<ConnectionSocketFactory> socketFactoryRegistry = RegistryBuilder.<ConnectionSocketFactory>create() .register("http", PlainConnectionSocketFactory.INSTANCE) .register("https", new SSLConnectionSocketFactory(sslcontext)) .build(); PoolingHttpClientConnectionManager connManager = new PoolingHttpClientConnectionManager(socketFactoryRegistry); HttpClients.custom().setConnectionManager(connManager); //创建自定义的httpclient对象 CloseableHttpClient client = HttpClients.custom().setConnectionManager(connManager).build(); return client; } 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 /** * 绕过验证 * * @return * @throws NoSuchAlgorithmException * @throws KeyManagementException */ static SSLContext createIgnoreVerifySSL() throws NoSuchAlgorithmException, KeyManagementException { SSLContext sc = SSLContext.getInstance("SSLv3"); // 实现一个X509TrustManager接口,用于绕过验证,不用修改里面的方法 X509TrustManager trustManager = new X509TrustManager() { @Override public void checkClientTrusted( java.security.cert.X509Certificate[] paramArrayOfX509Certificate, String paramString) throws CertificateException { } @Override public void checkServerTrusted( java.security.cert.X509Certificate[] paramArrayOfX509Certificate, String paramString) throws CertificateException { } @Override public java.security.cert.X509Certificate[] getAcceptedIssuers() { return null; } }; sc.init(null, new TrustManager[]{trustManager}, null); return sc; } public static CloseableHttpClient ignoreSSLClient() throws KeyManagementException, NoSuchAlgorithmException {//采用绕过验证的方式处理https请求 SSLContext sslcontext = HttpUtils.createIgnoreVerifySSL(); //设置协议http和https对应的处理socket链接工厂的对象 Registry<ConnectionSocketFactory> socketFactoryRegistry = RegistryBuilder.<ConnectionSocketFactory>create() .register("http", PlainConnectionSocketFactory.INSTANCE) .register("https", new SSLConnectionSocketFactory(sslcontext)) .build(); PoolingHttpClientConnectionManager connManager = new PoolingHttpClientConnectionManager(socketFactoryRegistry); HttpClients.custom().setConnectionManager(connManager); //创建自定义的httpclient对象 CloseableHttpClient client = HttpClients.custom().setConnectionManager(connManager).build(); return client; } &nbs… Read More