Node keeps giving me this error when I tried to read my self signed SSL certificate
_tls_common.js:67
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:67:17)
at Object.TLSSocket._init.ssl.onclienthello.ssl.oncertcb.exports.connect (_tls_wrap.js:1017:46)
at Socket.<anonymous> (/usr/blinkchannelserver/bundle/programs/server/npm/node_modules/pg/lib/connection.js:106:23)
at Socket.g (events.js:260:16)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at readableAddChunk (_stream_readable.js:153:18)
at Socket.Readable.push (_stream_readable.js:111:10)
at TCP.onread (net.js:540:20)
What format is this supposed to be in?
On my server, I created a client key and csr by running
openssl req -new -key ~/.postgresql/postgresql.key -out /tmp/postgresql.csr
I used my server key to turn the csr into a certificate using my server's certificate nd key
openssl x509 -req -in /tmp/postgresql.csr -CA server.cert -CAkey server.key -out /tmp/postgresql.cert -CAcreateserial
When I try to lost postgresql.cert I get the error above
Running x509:
openssl x509 -inform PEM -in postgresql.cert
gives me a reasonable output:
-----BEGIN CERTIFICATE-----
MIIDHDCCAgQCCQC8AZE7dSSPZDANBgkqhkiG9w0BAQsFADBRMQswCQYDVQQGEwJH
QjEPMA0GA1UEBwwGTG9uZG9uMR4wHAYDVQQKDBVEb3VnbGFzLVdoaXRlICYgR29z
...
-----END CERTIFICATE-----