Home | History | Annotate | Download | only in conscrypt

Lines Matching refs:socket

150                     "Not a conscrypt socket factory: " + factory.getClass().getName());
156 * Configures the default socket to be created for all socket factory instances.
165 * Configures the socket to be created for the given socket factory instance.
183 "Not a conscrypt server socket factory: " + factory.getClass().getName());
189 * Configures the socket to be created for the given server socket factory instance.
199 public static boolean isConscrypt(SSLSocket socket) {
200 return socket instanceof AbstractConscryptSocket;
203 private static AbstractConscryptSocket toConscrypt(SSLSocket socket) {
204 if (!isConscrypt(socket)) {
206 "Not a conscrypt socket: " + socket.getClass().getName());
208 return (AbstractConscryptSocket) socket;
213 * during socket creation.
215 * @param socket the socket
218 public static void setHostname(SSLSocket socket, String hostname) {
219 toConscrypt(socket).setHostname(hostname);
223 * Returns either the hostname supplied during socket creation or via
227 public static String getHostname(SSLSocket socket) {
228 return toConscrypt(socket).getHostname();
235 public static String getHostnameOrIP(SSLSocket socket) {
236 return toConscrypt(socket).getHostnameOrIP();
242 * @param socket the socket
245 public static void setUseSessionTickets(SSLSocket socket, boolean useSessionTickets) {
246 toConscrypt(socket).setUseSessionTickets(useSessionTickets);
250 * Enables/disables TLS Channel ID for the given server-side socket.
254 * @param socket the socket
256 * @throws IllegalStateException if this is a client socket or if the handshake has already
259 public static void setChannelIdEnabled(SSLSocket socket, boolean enabled) {
260 toConscrypt(socket).setChannelIdEnabled(enabled);
264 * Gets the TLS Channel ID for the given server-side socket. Channel ID is only available
267 * @param socket the socket
269 * @throws IllegalStateException if this is a client socket or if the handshake has not yet
273 public static byte[] getChannelId(SSLSocket socket) throws SSLException {
274 return toConscrypt(socket).getChannelId();
278 * Sets the {@link PrivateKey} to be used for TLS Channel ID by this client socket.
282 * @param socket the socket
288 * @throws IllegalStateException if this is a server socket or if the handshake has already
291 public static void setChannelIdPrivateKey(SSLSocket socket, PrivateKey privateKey) {
292 toConscrypt(socket).setChannelIdPrivateKey(privateKey);
298 * @param socket the socket
301 public static String getApplicationProtocol(SSLSocket socket) {
302 return toConscrypt(socket).getApplicationProtocol();
309 * @param socket the socket
312 public static void setApplicationProtocolSelector(SSLSocket socket,
314 toConscrypt(socket).setApplicationProtocolSelector(selector);
320 * @param socket the socket being configured
326 public static void setApplicationProtocols(SSLSocket socket, String[] protocols) {
327 toConscrypt(socket).setApplicationProtocols(protocols);
333 * @param socket the socket
337 public static String[] getApplicationProtocols(SSLSocket socket) {
338 return toConscrypt(socket).getApplicationProtocols();
346 public static byte[] getTlsUnique(SSLSocket socket) {
347 return toConscrypt(socket).getTlsUnique();
385 * Returns either the hostname supplied during socket creation or via