Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

https connections to servers with self-signed certificates #69

Closed
DATA-HORIZON opened this issue Feb 6, 2014 · 6 comments
Closed

https connections to servers with self-signed certificates #69

DATA-HORIZON opened this issue Feb 6, 2014 · 6 comments

Comments

@DATA-HORIZON
Copy link

Hello,

I am facing the problem that secure https connections to servers with domains that have self-signed certificates always end up in code 500 errors:

Message:
Expected 500 to equal 200

TCPDump shows up an reset flag in the connection.

If I connect to https servers with domains that have certificates signed from CA's everything wents fine.

I already installed my own CA certificate on my Debian server into the local certificate store. So wget and other programs do not make any trouble.

Any hints on that?

Best wishes
Michael

@DATA-HORIZON
Copy link
Author

Hello,

the same topic was discussed here:
request/request#418

Solution that worked for me:
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"

Another possible solution can be found here:
http://stackoverflow.com/questions/15254976/how-do-i-use-the-node-js-request-module-to-make-an-ssl-call-with-my-own-certific

Best wishes
Michael

@vlucas
Copy link
Owner

vlucas commented Feb 6, 2014

Awesome. Glad you found the solution!

@doug-nara
Copy link

This doesn't seem like a resolution to me. Frisby should be able to handle this.

@vlucas
Copy link
Owner

vlucas commented Jun 2, 2016

Frisby v0.x uses the request library, and passes all the options down to it. So Frisby supports this via request options.

Request SSL options are here:
https://github.com/request/request#tlsssl-protocol

e.g.

frisby.post('http://example.com', {field: 'value'}, {
    cert: fs.readFileSync(certFile),
    key: fs.readFileSync(keyFile),
    passphrase: 'password',
    ca: fs.readFileSync(caFile)
});

@jiawenzhang
Copy link

I set serverURL to http://localhost:8081/parse and it solved the problem. My parse is deployed to AWS Beanstalk, and port 8081 is what Beanstalk uses to run node server.

The client side serverURL is still using https.

@fletchgqc
Copy link

@vlucas your example works for me, thanks, but is there a way to include this in the globalSetup? I tried the obvious things and they didn't work for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants