@Override protected DTLSTransport getDtlsTransport() throws IOException { DTLSServerProtocol serverProtocol = new DTLSServerProtocol(secureRandom); return serverProtocol.accept(mserver, rawTransport); }
public void run() { DtlsHandler.this.rxQueue.clear(); SecureRandom secureRandom = new SecureRandom(); DTLSServerProtocol serverProtocol = new DTLSServerProtocol(secureRandom); try { // Perform the handshake in a non-blocking fashion serverProtocol.accept(server, DtlsHandler.this); // Prepare the shared key to be used in RTP streaming server.prepareSrtpSharedSecret(); // Generate encoders for DTLS traffic srtpDecoder = generateRtpDecoder(); srtpEncoder = generateRtpEncoder(); srtcpDecoder = generateRtcpDecoder(); srtcpEncoder = generateRtcpEncoder(); // Declare handshake as complete handshakeComplete = true; handshakeFailed = false; handshaking = false; // Warn listeners handshake completed fireHandshakeComplete(); } catch (Exception e) { logger.error("DTLS handshake failed. Reason:", e); // Declare handshake as failed handshakeComplete = false; handshakeFailed = true; handshaking = false; // Warn listeners handshake completed fireHandshakeFailed(e); } }
public void run() { DtlsHandler.this.rxQueue.clear(); SecureRandom secureRandom = new SecureRandom(); DTLSServerProtocol serverProtocol = new DTLSServerProtocol(secureRandom); try { // Perform the handshake in a non-blocking fashion serverProtocol.accept(server, DtlsHandler.this); // Prepare the shared key to be used in RTP streaming server.prepareSrtpSharedSecret(); // Generate encoders for DTLS traffic srtpDecoder = generateRtpDecoder(); srtpEncoder = generateRtpEncoder(); srtcpDecoder = generateRtcpDecoder(); srtcpEncoder = generateRtcpEncoder(); // Declare handshake as complete handshakeComplete = true; handshakeFailed = false; handshaking = false; // Warn listeners handshake completed fireHandshakeComplete(); } catch (Exception e) { logger.error("DTLS handshake failed. Reason:", e); // Declare handshake as failed handshakeComplete = false; handshakeFailed = true; handshaking = false; // Warn listeners handshake completed fireHandshakeFailed(e); } }
= dtlsServerProtocol.accept( tlsServer, datagramTransport);