Spoke icon indicating copy to clipboard operation
Spoke copied to clipboard

Selfsigned cert are too small and project wont run

Open edvardodegaard opened this issue 5 years ago • 3 comments

When running the project with npm or yarn I get an error: SSL_CTX_use_certificate:ee key too small

I think the default keysize is 1024. Setting keysize in the webpack config selfsigned.generate function specifically will allow the project to start properly:

Adding keysize: 2048 inside the function starting on line 31 in webpack.config.js solves my issue:

 31     const pems = selfsigned.generate(
 32       [
 33         {
 34           name: "commonName",
 35           value: "localhost"
 36         }
 37       ],
 38       {
 39         keySize: 2048,
 40         days: 365,
 41         algorithm: "sha256",
 42         extensions: [
 43           {
 44             name: "subjectAltName",
 45             altNames: [
 46               {
 47                 type: 2,
 48                 value: "localhost"
 49               },
 50               {
 51                 type: 2,
 52                 value: "hubs.local"
 53               }
 54             ]
 55           }
 56         ]
 57       }

Ubuntu 20.04 LTS, Linux 5.4.0-42-generic x86-64

I don't know of the implications of setting this in the default config, but I'd assume more people than me have this issue.

edvardodegaard avatar Jul 31 '20 12:07 edvardodegaard

Hi @robertlong ,

I faced same problem, but how can I resolve this issue with a local environment?

ClarkDuck avatar Mar 16 '22 10:03 ClarkDuck

Ohh, I resolved it by replace the old cert and key files with my own generated version. run this command. openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout key.pem -out cert.pem

ClarkDuck avatar Mar 16 '22 10:03 ClarkDuck

@robertlong, Btw, how can I deploy the spoke on the my own server what published with hubs? I want to deploy the modifed version of spoke on my server.

ClarkDuck avatar Mar 16 '22 10:03 ClarkDuck