cn.hutool.http.ssl.SSLSocketFactoryBuilder.setProtocol

HttpRequest.setSSLProtocol(...)

/**
 * 设置HTTPS安全连接协议,只针对HTTPS请求,可以使用的协议包括:<br>
 * 
 * <pre>
 * 1. TLSv1.2
 * 2. TLSv1.1
 * 3. SSLv3
 * ...
 * </pre>
 * 
 * @see SSLSocketFactoryBuilder
 * @param protocol 协议
 * @return this
 */
public HttpRequest setSSLProtocol(String protocol) {
  if (null == this.ssf) {
    try {
      this.ssf = SSLSocketFactoryBuilder.create().setProtocol(protocol).build();
    } catch (Exception e) {
      throw new HttpException(e);
    }
  }
  return this;
}
    •  
 

HttpRequest.setSSLProtocol(...)

/**
 * 设置HTTPS安全连接协议,只针对HTTPS请求,可以使用的协议包括:<br>
 * 
 * <pre>
 * 1. TLSv1.2
 * 2. TLSv1.1
 * 3. SSLv3
 * ...
 * </pre>
 * 
 * @see SSLSocketFactoryBuilder
 * @param protocol 协议
 * @return this
 */
public HttpRequest setSSLProtocol(String protocol) {
  if (null == this.ssf) {
    try {
      this.ssf = SSLSocketFactoryBuilder.create().setProtocol(protocol).build();
    } catch (Exception e) {
      throw new HttpException(e);
    }
  }
  return this;
}
    •  
 

HttpRequest.setSSLProtocol(...)

/**
 * 设置HTTPS安全连接协议,只针对HTTPS请求,可以使用的协议包括:<br>
 * 
 * <pre>
 * 1. TLSv1.2
 * 2. TLSv1.1
 * 3. SSLv3
 * ...
 * </pre>
 * 
 * @see SSLSocketFactoryBuilder
 * @param protocol 协议
 * @return this
 */
public HttpRequest setSSLProtocol(String protocol) {
  if (null == this.ssf) {
    try {
      this.ssf = SSLSocketFactoryBuilder.create().setProtocol(protocol).build();
    } catch (Exception e) {
      throw new HttpException(e);
    }
  }
  return this;
}
    •  
 

HttpRequest.setSSLProtocol(...)

/**
 * 设置HTTPS安全连接协议,只针对HTTPS请求,可以使用的协议包括:<br>
 * 
 * <pre>
 * 1. TLSv1.2
 * 2. TLSv1.1
 * 3. SSLv3
 * ...
 * </pre>
 * 
 * @see SSLSocketFactoryBuilder
 * @param protocol 协议
 * @return this
 */
public HttpRequest setSSLProtocol(String protocol) {
  if (null == this.ssf) {
    try {
      this.ssf = SSLSocketFactoryBuilder.create().setProtocol(protocol).build();
    } catch (Exception e) {
      throw new HttpException(e);
    }
  }
  return this;
}
posted @ 2023-02-28 10:22  锐洋智能  阅读(847)  评论(0编辑  收藏  举报