ALPN fixes

This commit is contained in:
mom040267 2014-12-15 02:49:37 +00:00
parent 6c845ced0e
commit a0ddb85245
2 changed files with 3 additions and 3 deletions

View File

@ -2357,12 +2357,12 @@ static int ServerALPNCallback(SSL *s,
unsigned char current_len = *ptr;
if(ptr+1+current_len > in+inlen)
break;
if((current_len == sa_len) && (memcmp(ptr+1,STUN_ALPN,sa_len)==0)) {
if((!turn_params.no_stun) && (current_len == sa_len) && (memcmp(ptr+1,STUN_ALPN,sa_len)==0)) {
*out = ptr+1;
*outlen = sa_len;
return SSL_TLSEXT_ERR_OK;
}
if((current_len == ta_len) && (memcmp(ptr+1,TURN_ALPN,ta_len)==0)) {
if((!turn_params.stun_only) && (current_len == ta_len) && (memcmp(ptr+1,TURN_ALPN,ta_len)==0)) {
*out = ptr+1;
*outlen = ta_len;
return SSL_TLSEXT_ERR_OK;

View File

@ -51,7 +51,7 @@ static int allocate_rtcp = 0;
static const int never_allocate_rtcp = 0;
#if ALPN_SUPPORTED
static const unsigned char kALPNProtos[] = "\x09stun.turn\x12stun.nat-discovery";
static const unsigned char kALPNProtos[] = "\x08http/1.1\x09stun.turn\x12stun.nat-discovery";
static const size_t kALPNProtosLen = sizeof(kALPNProtos) - 1;
#endif