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


Java OpenSSLSocketImpl类代码示例

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


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

示例1: enableTlsExtensions

import com.android.org.conscrypt.OpenSSLSocketImpl; //导入依赖的package包/类
public void enableTlsExtensions(SSLSocket socket, String uriHost) {
    if (socket instanceof OpenSSLSocketImpl) {
        OpenSSLSocketImpl openSSLSocket = (OpenSSLSocketImpl) socket;
        openSSLSocket.setUseSessionTickets(true);
        openSSLSocket.setHostname(uriHost);
    }
}
 
开发者ID:xin3liang,项目名称:platform_external_okhttp,代码行数:8,代码来源:Platform.java

示例2: getNpnSelectedProtocol

import com.android.org.conscrypt.OpenSSLSocketImpl; //导入依赖的package包/类
/**
 * Returns the negotiated protocol, or null if no protocol was negotiated.
 */
public ByteString getNpnSelectedProtocol(SSLSocket socket) {
    if (!(socket instanceof OpenSSLSocketImpl)) {
        return null;
    }

    OpenSSLSocketImpl socketImpl = (OpenSSLSocketImpl) socket;
    // Prefer ALPN's result if it is present.
    byte[] alpnResult = socketImpl.getAlpnSelectedProtocol();
    if (alpnResult != null) {
        return ByteString.of(alpnResult);
    }
    byte[] npnResult = socketImpl.getNpnSelectedProtocol();
    return npnResult == null ? null : ByteString.of(npnResult);
}
 
开发者ID:xin3liang,项目名称:platform_external_okhttp,代码行数:18,代码来源:Platform.java

示例3: setNpnProtocols

import com.android.org.conscrypt.OpenSSLSocketImpl; //导入依赖的package包/类
/**
 * Sets client-supported protocols on a socket to send to a server. The
 * protocols are only sent if the socket implementation supports NPN.
 */
public void setNpnProtocols(SSLSocket socket, List<Protocol> npnProtocols) {
    if (socket instanceof OpenSSLSocketImpl) {
        OpenSSLSocketImpl socketImpl = (OpenSSLSocketImpl) socket;
        byte[] protocols = concatLengthPrefixed(npnProtocols);
        socketImpl.setAlpnProtocols(protocols);
        socketImpl.setNpnProtocols(protocols);
    }
}
 
开发者ID:xin3liang,项目名称:platform_external_okhttp,代码行数:13,代码来源:Platform.java

示例4: getNpnSelectedProtocol

import com.android.org.conscrypt.OpenSSLSocketImpl; //导入依赖的package包/类
/**
 * Returns the negotiated protocol, or null if no protocol was negotiated.
 */
public byte[] getNpnSelectedProtocol(SSLSocket socket) {
    return socket instanceof OpenSSLSocketImpl
            ? ((OpenSSLSocketImpl) socket).getNpnSelectedProtocol()
            : null;
}
 
开发者ID:c-ong,项目名称:mirrored-okhttp,代码行数:9,代码来源:Platform.java

示例5: setNpnProtocols

import com.android.org.conscrypt.OpenSSLSocketImpl; //导入依赖的package包/类
/**
 * Sets client-supported protocols on a socket to send to a server. The
 * protocols are only sent if the socket implementation supports NPN.
 */
public void setNpnProtocols(SSLSocket socket, byte[] npnProtocols) {
    if (socket instanceof OpenSSLSocketImpl) {
        ((OpenSSLSocketImpl) socket).setNpnProtocols(npnProtocols);
    }
}
 
开发者ID:c-ong,项目名称:mirrored-okhttp,代码行数:10,代码来源:Platform.java


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