Client certificate isn't been recognized
See original GitHub issueHi,
I’m creating a proxy to a server that uses certificate authentication.
server.middleware = proxyMiddleware('/providers/sse/services/scim',
{target: 'https://backendserver.com',
changeOrigin: true,
port: 443,
secure: true, // ignore cert errors
agent: false,
https: {
key: fs.readFileSync('private_key.pem'),
cert: fs.readFileSync('client_cert.pem')
},
});
However, when I connect to my server, I’m being prompted for the credentials when the request is being forwarded to the backend server.
At the same time, the following code (written by someone else) that creates an http server directly, passing the same client certificate data, passes the client cert data successfully, and I can retrieve data from the backend server without a prompt:
http.createServer(onRequest).listen(3030);
function onRequest(client_req, client_res) {
var options = {
key: fs.readFileSync('private_key.pem'),
cert: fs.readFileSync('client_cert.pem'),
agent: false,
host: backendserver,
method: client_req.method,
path: client_req.url,
headers:{
Host: backendserver
}
};
var proxy = https.get(options, function(res) {
client_res.on('data', function(d) {
});
res.pipe(client_res, {
end: true
});
});
client_req.pipe(proxy, {
end: true
});
Any idea of what might be wrong?
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Client Certificate not recognized - TechNet - Microsoft
Hello,. I try to migrate my SCCM 2012 SP1 clients to PKI-authenticated communication, but the client certificates are not recognized or ...
Read more >Client certificate not recognized - webMethods
Hi,. We have had some client certificate issues as well … The solution was reimporting the client certificate and then it worked fine...
Read more >Azure App Service "The Client Certificate Credentials Were ...
But when this API is deployed as an Azure App Service it states "The Client Certificate Credentials Were Not Recognized".
Read more >GlobalProtect failed to connect - required client certificate i...
The certificate imported to the client machine(s) may or may not be signed the same root CA which signed the 'Server Certificate' in...
Read more >SSL Client Certificate Authentication not working. What am I ...
1. SSL Client Certificate Authentication not working. What am I missing? · 1- Created a private key using Policy Manager · 2- Exported...
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
I figured this out, finally. Instead of providing certificate and key as part of the https (or ssl) object, it should be a part of the target object:
had the same issue: try removing the ‘https://’ part in your host option