Skip to content

Commit

Permalink
Set MTU on DTLS SSL BIO (#217)
Browse files Browse the repository at this point in the history
Avoid DTLS fragmentation (fixes #4)
  • Loading branch information
michaelfig authored and ibc committed Oct 11, 2018
1 parent e49a418 commit 3d5bc02
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion worker/src/RTC/DtlsTransport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,9 @@ namespace RTC
// Set options.
SSL_CTX_set_options(
DtlsTransport::sslCtx,
SSL_OP_CIPHER_SERVER_PREFERENCE | SSL_OP_NO_TICKET | SSL_OP_SINGLE_ECDH_USE);
SSL_OP_CIPHER_SERVER_PREFERENCE | SSL_OP_NO_TICKET | SSL_OP_SINGLE_ECDH_USE |
SSL_OP_NO_QUERY_MTU
);

// Don't use sessions cache.
SSL_CTX_set_session_cache_mode(DtlsTransport::sslCtx, SSL_SESS_CACHE_OFF);
Expand Down Expand Up @@ -542,7 +544,11 @@ namespace RTC
goto error;
}


SSL_set_bio(this->ssl, this->sslBioFromNetwork, this->sslBioToNetwork);
// Set the MTU so that we don't send packets that are too large, with no fragmentation.
SSL_set_mtu(this->ssl, 1200);
DTLS_set_link_mtu(this->ssl, 1200);

/* Set the DTLS timer. */

Expand Down

0 comments on commit 3d5bc02

Please sign in to comment.