Skip to content

no shared cipher error if cert is loaded later #49549

@kumarrishav

Description

@kumarrishav

Version

v16.20.0

Platform

Darwin xxxx 22.6.0 Darwin Kernel Version 22.6.0: Wed Jul 5 22:22:05 PDT 2023; root:xnu-8796.141.3~6/RELEASE_ARM64_T6000 x86_64

Subsystem

No response

What steps will reproduce the bug?

create securityContext and load the cert later

        ...
       const tlsOptions = {}
        tlsOptions.ciphers = options.ciphers;
	const secureContext = Tls.createSecureContext(tlsOptions);
	secureContext.context.setCert(cert);
        options.secureContext = secureContext;
        .....
       delete options.ciphers
       delete options.cert
       Https.createServer(options)

#46515

#36655 (comment)

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior? Why is that the expected behavior?

No response

What do you see instead?

TLS 40052: server emit tlsClientError: Error: 8138940544:error:1417A0C1:SSL routines:tls_post_process_client_hello:no shared cipher:../deps/openssl/openssl/ssl/statem/statem_srvr.c:2313:

    at TLSWrap.loadSession [as onclienthello] (node:_tls_wrap:205:19)
    at TLSWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
  library: 'SSL routines',
  function: 'tls_post_process_client_hello',
  reason: 'no shared cipher',
  code: 'ERR_SSL_NO_SHARED_CIPHER'
}
9/7/2023, 7:46:47 PM UNCAUGHTEXCEPTION Error: write EPROTO 8138940544:error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure:../deps/openssl/openssl/ssl/record/rec_layer_s3.c:1565:SSL alert number 40

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions