mock-server / mockserver-client-node

MockServer javascript client for browsers, Node.js or any grunt build
http://mock-server.com
Apache License 2.0
72 stars 34 forks source link

When specifying caCertPemFilePath the Certificate is still downloaded from github. #63

Closed Caribosaurus closed 2 years ago

Caribosaurus commented 3 years ago

Describe the issue When specifying the caCertPemFilePath or tls =false, The certificate is still downloaded from github.

What you are trying to do we are behind a corporate proxy blocking the request to raw.githubusercontent.com. I would expect me specifyng the CaPath to not download a certificate that will never be used. This condition should be if tls && !caCertPemFilePath && !fs.existsSync('./' + dest) or something along those lines.

rodgarci commented 3 years ago

Describe the issue When specifying the caCertPemFilePath or tls =false, The certificate is still downloaded from github.

What you are trying to do we are behind a corporate proxy blocking the request to raw.githubusercontent.com. I would expect me specifyng the CaPath to not download a certificate that will never be used. This condition should be if tls && !caCertPemFilePath && !fs.existsSync('./' + dest) or something along those lines.

I'm in the same situation than @Caribosaurus, I work behind a corporate proxy and I can't access internet from ci. I had to downgrade to version 5.6.1 to make it work (avoid downloading a certificate)

Caribosaurus commented 3 years ago

@rodgarci as a temporary fix, you can place a CertificateAuthorityCertificate.pem in the folder where you execute your tests from (process.cwd()). it can even be empty

zhangmx commented 3 years ago

It's really bad for somewhere can't visit 'raw.githubusercontent.com' because GFW or something else. So, would you put ‘ CertificateAuthorityCertificate.pem’ file inside this project?

rodgarci commented 3 years ago

@zhangmx just in case you don't need tls like me, the @Caribosaurus PR #64 was merged (not released yet). It means that if you don't enable tls on your mockServerClient, it won't try to download CA anymore

zhangmx commented 3 years ago

@rodgarci thank you very much~

ErikBooij commented 3 years ago

I'm running into the same issue and was pleasantly surprised to see a fix was already merged 🎉 Now I'm just wondering, @jamesdbloom, are you planning to release (or would you be willing to consider releasing) a patch version with this improvement merged in? 🙂

If not, I respect that, if you do, I'd greatly appreciate it 😃

luk355 commented 2 years ago

@jamesdbloom, any chance you can release new version anytime soon please?

jamesdbloom commented 2 years ago

This is related to https://github.com/mock-server/mockserver-node/issues/28 because multiple JVM options were not honoured that has now been fixed so believe this should now be fixed as well but I'll double check.

jamesdbloom commented 2 years ago

I will release new version in next couple weeks once fixing a couple more issues

jamesdbloom commented 2 years ago

I now even further improved the handling of jvmOptions so either arrays or a single string are now supported in relation to this https://github.com/mock-server/mockserver-node/issues/27.

This will be released in next few weeks.