Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSL routines:SSL_CTX_use_certificate:ee key too small #33

Open
Einstein42 opened this issue Sep 25, 2019 · 2 comments · May be fixed by #70
Open

SSL routines:SSL_CTX_use_certificate:ee key too small #33

Einstein42 opened this issue Sep 25, 2019 · 2 comments · May be fixed by #70

Comments

@Einstein42
Copy link

Einstein42 commented Sep 25, 2019

var clientkeys = forge.pki.rsa.generateKeyPair(1024);

    var opts = {
        keySize: 2048,
        algorithm: 'sha256',
        days: 365 * 10,
        clientCertificate: true,
        clientCertificateCN: 'client_name'
      }

var pems = await selfsigned.generate(attrs, opts)

Trying use the client certificate to connect to the server. In this case MQTT.JS connecting to AEDES.

On debian I receive the error message

Error: error:140AB18F:SSL routines:SSL_CTX_use_certificate:ee key too small

OpenSSL 1.1.1d 10 Sep 2019

Only way around it is to modify: /etc/ssl/openssl.cnf and change:

CipherString = DEFAULT@SECLEVEL=2
to
CipherString = DEFAULT@SECLEVEL=1

I believe the issue is the referenced issue above and generating the client certificates as 1024 bit. SECLEVEL=2 requires minimum of 2048 bit.

Expose a option for clientCertificateKeySize just like you use keySize for the server side and that should satisfy the requirements. That or just use keySize for both would be fine as well.

@blahah
Copy link

blahah commented Nov 26, 2019

For modern implementations the keySize should default to 2048 anyway, and as you rightly point out should be applied to both keys.

PR incoming...

blahah pushed a commit to blahah/selfsigned that referenced this issue Nov 26, 2019
julien-f added a commit to vatesfr/xen-orchestra that referenced this issue Apr 15, 2020
This module appears to be no longer maintained and is not compatible with Node 12.

See jfromaniello/selfsigned#33
julien-f added a commit to vatesfr/xen-orchestra that referenced this issue Apr 15, 2020
This module appears to be no longer maintained and is not compatible with Node 12.

See jfromaniello/selfsigned#33
@euneuber
Copy link

euneuber commented Mar 8, 2021

I had this error with OpenSSL 1.1.1j (2021-02-16) because of private key size is only 1024 bit as default.

Please increase the default private key size to 2048 bit!

sschwarzer added a commit to sschwarzer/racket-pkg-website that referenced this issue Jul 10, 2021
With the default key size of 1024, when I start the server with
`make compile run`, I see several stacktraces with the message

  #<thread:'package-change-handler>
  *** DAEMON CRASHED: main-web-server-thread ***
  ssl-load-certificate-chain!: load failed from: #<path:/home/schwa/sd/racket/racket-pkg-website/src/../server-cert.pem> (error:140AB18F:SSL routines:SSL_CTX_use_certificate:ee key too small)
    context...:

jfromaniello/selfsigned#33 suggests increasing
the key size to at least 2048 bits. Increasing the key size in the
Makefile makes the above stacktraces go away.

I set the key size in the Makefile to 4096 to make it more
"future-proof", but feel free to use a key size of 2048, which works for
me as well.
HaTiIn added a commit to Fiplana/selfsigned that referenced this issue Nov 7, 2024
@HaTiIn HaTiIn linked a pull request Nov 7, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants