Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fc11db1

Browse filesBrowse files
committed
src: inline SetSNICallback
Refs: #30548 (comment) PR-URL: #30548 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
1 parent 7bd587e commit fc11db1
Copy full SHA for fc11db1

File tree

Expand file treeCollapse file tree

3 files changed

+6
-18
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

3 files changed

+6
-18
lines changed
Open diff view settings
Collapse file

‎src/node_crypto.cc‎

Copy file name to clipboardExpand all lines: src/node_crypto.cc
+1-16Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ static bool extra_root_certs_loaded = false;
142142
template void SSLWrap<TLSWrap>::AddMethods(Environment* env,
143143
Local<FunctionTemplate> t);
144144
template void SSLWrap<TLSWrap>::ConfigureSecureContext(SecureContext* sc);
145-
template void SSLWrap<TLSWrap>::SetSNIContext(SecureContext* sc);
146145
template int SSLWrap<TLSWrap>::SetCACerts(SecureContext* sc);
147146
template void SSLWrap<TLSWrap>::MemoryInfo(MemoryTracker* tracker) const;
148147
template SSL_SESSION* SSLWrap<TLSWrap>::GetSessionCallback(
@@ -2993,12 +2992,7 @@ void SSLWrap<Base>::CertCbDone(const FunctionCallbackInfo<Value>& args) {
29932992
if (cons->HasInstance(ctx)) {
29942993
SecureContext* sc = Unwrap<SecureContext>(ctx.As<Object>());
29952994
CHECK_NOT_NULL(sc);
2996-
// XXX: There is a method w->SetSNIContext(sc), and you might think that
2997-
// it makes sense to call that here and make setting w->sni_context_ part
2998-
// of it. In fact, that passes the test suite, although SetSNIContext()
2999-
// performs a lot more operations.
3000-
// If anybody is familiar enough with the TLS code to know whether it makes
3001-
// sense, please do so or document why it doesn't.
2995+
// Store the SNI context for later use.
30022996
w->sni_context_ = BaseObjectPtr<SecureContext>(sc);
30032997

30042998
int rv;
@@ -3057,15 +3051,6 @@ void SSLWrap<Base>::DestroySSL() {
30573051
}
30583052

30593053

3060-
template <class Base>
3061-
void SSLWrap<Base>::SetSNIContext(SecureContext* sc) {
3062-
ConfigureSecureContext(sc);
3063-
CHECK_EQ(SSL_set_SSL_CTX(ssl_.get(), sc->ctx_.get()), sc->ctx_.get());
3064-
3065-
SetCACerts(sc);
3066-
}
3067-
3068-
30693054
template <class Base>
30703055
int SSLWrap<Base>::SetCACerts(SecureContext* sc) {
30713056
int err = SSL_set1_verify_cert_store(ssl_.get(),
Collapse file

‎src/node_crypto.h‎

Copy file name to clipboardExpand all lines: src/node_crypto.h
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,6 @@ class SSLWrap {
288288

289289
void DestroySSL();
290290
void WaitForCertCb(CertCb cb, void* arg);
291-
void SetSNIContext(SecureContext* sc);
292291
int SetCACerts(SecureContext* sc);
293292

294293
inline Environment* ssl_env() const {
Collapse file

‎src/tls_wrap.cc‎

Copy file name to clipboardExpand all lines: src/tls_wrap.cc
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1068,7 +1068,11 @@ int TLSWrap::SelectSNIContextCallback(SSL* s, int* ad, void* arg) {
10681068
SecureContext* sc = Unwrap<SecureContext>(ctx.As<Object>());
10691069
CHECK_NOT_NULL(sc);
10701070
p->sni_context_ = BaseObjectPtr<SecureContext>(sc);
1071-
p->SetSNIContext(sc);
1071+
1072+
p->ConfigureSecureContext(sc);
1073+
CHECK_EQ(SSL_set_SSL_CTX(p->ssl_.get(), sc->ctx_.get()), sc->ctx_.get());
1074+
p->SetCACerts(sc);
1075+
10721076
return SSL_TLSEXT_ERR_OK;
10731077
}
10741078

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.