| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -89,12 +89,6 @@ void LogSecret( | |||
| 89 | 89 | keylog_cb(ssl.get(), line.c_str()); | |
| 90 | 90 | } | |
| 91 | 91 | ||
| 92 | - bool SetALPN(const SSLPointer& ssl, std::string_view alpn) { | ||
| 93 | - return SSL_set_alpn_protos(ssl.get(), | ||
| 94 | - reinterpret_cast<const uint8_t*>(alpn.data()), | ||
| 95 | - alpn.length()) == 0; | ||
| 96 | - } | ||
| 97 | - | ||
| 98 | 92 | MaybeLocal<Value> GetSSLOCSPResponse( | |
| 99 | 93 | Environment* env, | |
| 100 | 94 | SSL* ssl, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -33,9 +33,6 @@ void LogSecret( | |||
| 33 | 33 | const unsigned char* secret, | |
| 34 | 34 | size_t secretlen); | |
| 35 | 35 | ||
| 36 | - // TODO(tniessen): use std::u8string_view when we switch to C++20. | ||
| 37 | - bool SetALPN(const SSLPointer& ssl, std::string_view alpn); | ||
| 38 | - | ||
| 39 | 36 | v8::MaybeLocal<v8::Value> GetSSLOCSPResponse( | |
| 40 | 37 | Environment* env, | |
| 41 | 38 | SSL* ssl, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1529,17 +1529,18 @@ void TLSWrap::SetALPNProtocols(const FunctionCallbackInfo<Value>& args) { | |||
| 1529 | 1529 | if (args.Length() < 1 || !Buffer::HasInstance(args[0])) | |
| 1530 | 1530 | return env->ThrowTypeError("Must give a Buffer as first argument"); | |
| 1531 | 1531 | ||
| 1532 | + SSL* ssl = w->ssl_.get(); | ||
| 1532 | 1533 | if (w->is_client()) { | |
| 1533 | - ArrayBufferViewContents<char> protos(args[0].As<ArrayBufferView>()); | ||
| 1534 | - CHECK(SetALPN(w->ssl_, {protos.data(), protos.length()})); | ||
| 1534 | + ArrayBufferViewContents<uint8_t> protos(args[0].As<ArrayBufferView>()); | ||
| 1535 | + CHECK_EQ(0, SSL_set_alpn_protos(ssl, protos.data(), protos.length())); | ||
| 1535 | 1536 | } else { | |
| 1536 | 1537 | CHECK( | |
| 1537 | 1538 | w->object()->SetPrivate( | |
| 1538 | 1539 | env->context(), | |
| 1539 | 1540 | env->alpn_buffer_private_symbol(), | |
| 1540 | 1541 | args[0]).FromJust()); | |
| 1541 | 1542 | // Server should select ALPN protocol from list of advertised by client | |
| 1542 | - SSL_CTX_set_alpn_select_cb(SSL_get_SSL_CTX(w->ssl_.get()), | ||
| 1543 | + SSL_CTX_set_alpn_select_cb(SSL_get_SSL_CTX(ssl), | ||
| 1543 | 1544 | SelectALPNCallback, | |
| 1544 | 1545 | nullptr); | |
| 1545 | 1546 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments