using a self-signed certificate results in a request error
See original GitHub issueI use to self signed certificate for dev. In node code I try to get some recources from the same domain on another port
import request from 'superagent';
...
const key = fs.readFileSync('certs/server.key');
const cert = fs.readFileSync('certs/server.crt');
....
try {
const agent = request.agent();
const response = await agent
.get(runtimeUrl)
.key(key)
.cert(cert)
.buffer(true);
return response.text;
} catch (error) {
logError(error);
}
but get error:
Error: unable to verify the first certificate
[1] at TLSSocket.onConnectSecure (_tls_wrap.js:1060:34)
[1] at TLSSocket.emit (events.js:182:13)
[1] at TLSSocket._finishInit (_tls_wrap.js:639:8) code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', response: undefined }
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
A Simple Explanation of SSL Certificate Errors & How to Fix ...
This error indicates that the SSL certificate is signed or approved by a company that the browser does not trust. That means either...
Read more >using a self-signed certificate results in a request error #1376
I use to self signed certificate for dev. In node code I try to get some recources from the same domain on another...
Read more >Ignore invalid self-signed ssl certificate in node.js with https ...
ERROR: certificate common name `Linksys' doesn't match requested host name `192.168.1.1'. To connect to 192.168.1.1 insecurely, use `--no-check-certificate'.
Read more >iOS 11 HTTPS network request failure with self-signed cert
For testing purpose, we use a self-signed cert, loaded as a bundle resource for network requests. It works fine on Xcode8 + iOS10...
Read more >HTTP Connector | Error: self signed certificate in certificate ...
A possible reason is that the certificate Issuer is not a trusted certificate authority.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks! It helped!
I’m sorry - I have found solution: instead of using IP it should be used machine name! Thanks!