您现在的位置是:主页 > news > 南通做网站企业/知乎关键词优化软件

南通做网站企业/知乎关键词优化软件

admin2025/6/13 1:00:47news

简介南通做网站企业,知乎关键词优化软件,如何做内网网站,网站建设与管理专业2019独角兽企业重金招聘Python工程师标准>>> 1、制作证书时使用IP作为CN值; 2、将制作出来的客户端证书以IP为alias导入证书库(cacerts); 3、重写cas-client-core(我用的是3.4.1)中的CommonUtil…

南通做网站企业,知乎关键词优化软件,如何做内网网站,网站建设与管理专业2019独角兽企业重金招聘Python工程师标准>>> 1、制作证书时使用IP作为CN值; 2、将制作出来的客户端证书以IP为alias导入证书库(cacerts); 3、重写cas-client-core(我用的是3.4.1)中的CommonUtil…

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

1、制作证书时使用IP作为CN值;

2、将制作出来的客户端证书以IP为alias导入证书库(cacerts);

3、重写cas-client-core(我用的是3.4.1)中的CommonUtils.getResponseFromServer(final URL constructedUrl, final HttpURLConnectionFactory factory,
            final String encoding)方法;

修改HostnameVerifier的规则

/*** Contacts the remote URL and returns the response.** @param constructedUrl the url to contact.* @param factory connection factory to prepare the URL connection instance* @param encoding the encoding to use.* @return the response.*/public static String getResponseFromServer(final URL constructedUrl, final HttpURLConnectionFactory factory,final String encoding) {HttpURLConnection conn = null;InputStreamReader in = null;try {// 增加的内容if(factory instanceof HttpsURLConnectionFactory) {((HttpsURLConnectionFactory) factory).setHostnameVerifier(new HostnameVerifier() {@Overridepublic boolean verify(String hostname, SSLSession session) {return constructedUrl.getHost().equals(hostname);}});}conn = factory.buildHttpURLConnection(constructedUrl.openConnection());if (CommonUtils.isEmpty(encoding)) {in = new InputStreamReader(conn.getInputStream());} else {in = new InputStreamReader(conn.getInputStream(), encoding);}final StringBuilder builder = new StringBuilder(255);int byteRead;while ((byteRead = in.read()) != -1) {builder.append((char) byteRead);}return builder.toString();} catch (final Exception e) {LOGGER.error(e.getMessage(), e);throw new RuntimeException(e);} finally {closeQuietly(in);if (conn != null) {conn.disconnect();}}}

 

转载于:https://my.oschina.net/kevinpan45/blog/1527499