当前位置: 首页>>代码示例>>Java>>正文


Java JsseSSLManager类代码示例

本文整理汇总了Java中org.apache.jmeter.util.JsseSSLManager的典型用法代码示例。如果您正苦于以下问题:Java JsseSSLManager类的具体用法?Java JsseSSLManager怎么用?Java JsseSSLManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


JsseSSLManager类属于org.apache.jmeter.util包,在下文中一共展示了JsseSSLManager类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createSocket

import org.apache.jmeter.util.JsseSSLManager; //导入依赖的package包/类
protected Socket createSocket(String host, int port, int connectTimeout, int readTimeout) throws IOException {
    Socket baseSocket = new Socket();
    if (useProxy) {
        log.debug("Using http proxy " + proxyHost + ":" + proxyPort + " for " + connectUrl);
        setupProxyConnection(baseSocket, connectTimeout);
    }
    else
        baseSocket.connect(new InetSocketAddress(host, port), connectTimeout);

    if ("https".equals(connectUrl.getProtocol())) {
        baseSocket.setSoTimeout(readTimeout);

        JsseSSLManager sslMgr = (JsseSSLManager) SSLManager.getInstance();
        try {
            SSLSocketFactory tlsSocketFactory = sslMgr.getContext().getSocketFactory();
            log.debug("Starting TLS connection.");
            return tlsSocketFactory.createSocket(baseSocket, host, port, true);
        } catch (GeneralSecurityException e) {
            throw new IOException(e);
        }
    }
    else {
        return baseSocket;
    }
}
 
开发者ID:ptrd,项目名称:jmeter-websocket-samplers,代码行数:26,代码来源:WebSocketClient.java

示例2: SlowHC4SSLSocketFactory

import org.apache.jmeter.util.JsseSSLManager; //导入依赖的package包/类
/**
 * Create a factory 
 * @param cps - characters per second, must be > 0
 * @throws GeneralSecurityException if there's a problem setting up the security
 * @throws IllegalArgumentException if cps ≤ 0
 */
public SlowHC4SSLSocketFactory(final int cps) throws GeneralSecurityException {
    super(new HttpSSLProtocolSocketFactory((JsseSSLManager)JsseSSLManager.getInstance(), cps));
}
 
开发者ID:johrstrom,项目名称:cloud-meter,代码行数:10,代码来源:SlowHC4SSLSocketFactory.java

示例3: HC4TrustAllSSLSocketFactory

import org.apache.jmeter.util.JsseSSLManager; //导入依赖的package包/类
/**
 * Create an SSL factory which trusts all certificates and hosts.
 * {@link SSLSocketFactory#SSLSocketFactory(TrustStrategy, org.apache.http.conn.ssl.X509HostnameVerifier)} 
 * @throws GeneralSecurityException if there's a problem setting up the security
 */
public HC4TrustAllSSLSocketFactory() throws GeneralSecurityException {
    this(new HttpSSLProtocolSocketFactory((JsseSSLManager)JsseSSLManager.getInstance(), JsseSSLManager.CPS));
}
 
开发者ID:johrstrom,项目名称:cloud-meter,代码行数:9,代码来源:HC4TrustAllSSLSocketFactory.java


注:本文中的org.apache.jmeter.util.JsseSSLManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。