1275 setEnabledProtocols(s); 1276 } 1277 if (params.getNeedClientAuth()) { 1278 setNeedClientAuth(true); 1279 } else if (params.getWantClientAuth()) { 1280 setWantClientAuth(true); 1281 } else { 1282 setWantClientAuth(false); 1283 } 1284 } 1285 1286 /** 1287 * Returns the most recent application protocol value negotiated for this 1288 * connection. 1289 * <p> 1290 * If supported by the underlying SSL/TLS/DTLS implementation, 1291 * application name negotiation mechanisms such as <a 1292 * href="http://www.ietf.org/rfc/rfc7301.txt"> RFC 7301 </a>, the 1293 * Application-Layer Protocol Negotiation (ALPN), can negotiate 1294 * application-level values between peers. 1295 * <p> 1296 * @implSpec 1297 * The implementation in this class throws 1298 * {@code UnsupportedOperationException} and performs no other action. 1299 * 1300 * @return null if it has not yet been determined if application 1301 * protocols might be used for this connection, an empty 1302 * {@code String} if application protocols values will not 1303 * be used, or a non-empty application protocol {@code String} 1304 * if a value was successfully negotiated. 1305 * @throws UnsupportedOperationException if the underlying provider 1306 * does not implement the operation. 1307 * @since 9 1308 */ 1309 public String getApplicationProtocol() { 1310 throw new UnsupportedOperationException(); 1311 } 1312 1313 /** 1314 * Returns the application protocol value negotiated on a SSL/TLS 1315 * handshake currently in progress. 1316 * <p> 1317 * Like {@link #getHandshakeSession()}, 1318 * a connection may be in the middle of a handshake. The 1319 * application protocol may or may not yet be available. 1320 * <p> 1321 * @implSpec 1322 * The implementation in this class throws 1323 * {@code UnsupportedOperationException} and performs no other action. 1324 * 1325 * @return null if it has not yet been determined if application 1326 * protocols might be used for this handshake, an empty 1327 * {@code String} if application protocols values will not 1328 * be used, or a non-empty application protocol {@code String} 1329 * if a value was successfully negotiated. 1330 * @throws UnsupportedOperationException if the underlying provider 1331 * does not implement the operation. 1332 * @since 9 1333 */ 1334 public String getHandshakeApplicationProtocol() { 1335 throw new UnsupportedOperationException(); 1336 } 1337 1338 /** 1339 * Registers a callback function that selects an application protocol 1340 * value for a SSL/TLS/DTLS handshake. | 1275 setEnabledProtocols(s); 1276 } 1277 if (params.getNeedClientAuth()) { 1278 setNeedClientAuth(true); 1279 } else if (params.getWantClientAuth()) { 1280 setWantClientAuth(true); 1281 } else { 1282 setWantClientAuth(false); 1283 } 1284 } 1285 1286 /** 1287 * Returns the most recent application protocol value negotiated for this 1288 * connection. 1289 * <p> 1290 * If supported by the underlying SSL/TLS/DTLS implementation, 1291 * application name negotiation mechanisms such as <a 1292 * href="http://www.ietf.org/rfc/rfc7301.txt"> RFC 7301 </a>, the 1293 * Application-Layer Protocol Negotiation (ALPN), can negotiate 1294 * application-level values between peers. 1295 * 1296 * @implSpec 1297 * The implementation in this class throws 1298 * {@code UnsupportedOperationException} and performs no other action. 1299 * 1300 * @return null if it has not yet been determined if application 1301 * protocols might be used for this connection, an empty 1302 * {@code String} if application protocols values will not 1303 * be used, or a non-empty application protocol {@code String} 1304 * if a value was successfully negotiated. 1305 * @throws UnsupportedOperationException if the underlying provider 1306 * does not implement the operation. 1307 * @since 9 1308 */ 1309 public String getApplicationProtocol() { 1310 throw new UnsupportedOperationException(); 1311 } 1312 1313 /** 1314 * Returns the application protocol value negotiated on a SSL/TLS 1315 * handshake currently in progress. 1316 * <p> 1317 * Like {@link #getHandshakeSession()}, 1318 * a connection may be in the middle of a handshake. The 1319 * application protocol may or may not yet be available. 1320 * 1321 * @implSpec 1322 * The implementation in this class throws 1323 * {@code UnsupportedOperationException} and performs no other action. 1324 * 1325 * @return null if it has not yet been determined if application 1326 * protocols might be used for this handshake, an empty 1327 * {@code String} if application protocols values will not 1328 * be used, or a non-empty application protocol {@code String} 1329 * if a value was successfully negotiated. 1330 * @throws UnsupportedOperationException if the underlying provider 1331 * does not implement the operation. 1332 * @since 9 1333 */ 1334 public String getHandshakeApplicationProtocol() { 1335 throw new UnsupportedOperationException(); 1336 } 1337 1338 /** 1339 * Registers a callback function that selects an application protocol 1340 * value for a SSL/TLS/DTLS handshake. |