Error tryng to use certificates "error:0906D06C:PEM"

Hi

I have obtained a cert using :
sudo certbot certonly --webroot -w /home/matthieu/helping-pong_nuxt/static/ -d www.helping-pong.com -d helping-pong.com

I obtained the error :
_tls_common.js:69
c.context.setCert(options.cert);
^

Error: error:0906D06C:PEM routines:PEM_read_bio:no start line
    at Error (native)

when I run the server that calls the cert and key.

Details follow :

My domain is: helping-pong.com

I ran this command:
sudo certbot certonly --webroot -w /home/matthieu/helping-pong_nuxt/static/ -d www.helping-pong.com -d helping-pong.com

It produced this output:

    Generating key (2048 bits): /etc/letsencrypt/keys/0000_key-certbot.pem
    Creating CSR: /etc/letsencrypt/csr/0000_csr-certbot.pem

    IMPORTANT NOTES:
     - Congratulations! Your certificate and chain have been saved at
       /etc/letsencrypt/live/www.helping-pong.com/fullchain.pem. Your cert
       will expire on 2017-09-29. To obtain a new or tweaked version of
       this certificate in the future, simply run certbot again. To
       non-interactively renew *all* of your certificates, run "certbot
       renew"

I only have on cert, I have checked it with sudo certbot delete

My web server is (include version): Debian 8

When I call the certificated via my node application :

httpProxy_app.createProxyServer({
    target:'http://localhost:3000',
    ws : true ,
    agent: agent_app,
    ssl: {
      **key: fs.readFileSync('/etc/letsencrypt/keys/0000_key-certbot.pem', 'utf8'),**

** cert: fs.readFileSync(’/etc/letsencrypt/csr/0000_csr-certbot.pem’, ‘utf8’)**
}
},

I have obtained the following error ;

_tls_common.js:69
      c.context.setCert(options.cert);
                ^

Error: error:0906D06C:PEM routines:PEM_read_bio:no start line
    at Error (native)
    at Object.createSecureContext (_tls_common.js:69:17)
    at Server (_tls_wrap.js:776:25)
    at new Server (https.js:26:14)
    at Object.exports.createServer (https.js:47:10)
    at ProxyServer.listen (/home/matthieu/helping-pong_nuxt/node_modules/http-proxy/lib/http-proxy/index.js:128:11)
    at Object.<anonymous> (/home/matthieu/helping-pong_nuxt/proxy.js:31:50)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)

try using the “live” links:
/etc/letsencrypt/live/…
instead of the direct 0000… links

It works. Many thanks !
Matthieu

Maybe a further example in support of my suggestion

Anyway, I will try to change the output of Certbot so that it at least doesn’t mention these files routinely.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.