-
Notifications
You must be signed in to change notification settings - Fork 114
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
Error raised when testing with an https outbound request #63
Comments
Hello, Same problem here for testing a library that requires HTTPS (because implementing RFC8414). Looking at the code of Bypass, there are no options to enable HTTPS requests instead of HTTP request. It should be possible to implement it by switching to ranch_ssl when such an option would be set and generating a keypair {private key, certificate} on startup. |
In tests you pass in a custom endpoint anyway, to direct the client to Bypass, so passing in an additional option to set the CA store shouldn't be such a big deal, no? Using a self-signed server cert would require a custom Is it safe to assume Bypass will always be used with 'localhost' as the hostname, or are there use-cases where a different hostname would be required? |
Wouldn't be a big deal technically speaking, but it would mean having that parameter (similar to {:ok, client} = TwitterClient.start_link(url: endpoint_url(bypass.port))
assert {:error, :rate_limited} == TwitterClient.post_tweet(client, "Elixir is awesome!", ssl: [cacerts: [<newly_generated_certificate>]]) Not very elegant in my opinion, and it allows the users of the library to actually modify SSL (and other) options of the HTTP request. Regarding getting a real keypair from a recognized CA, do you think that could be accepted? There would be an expiration date anyway. Using localhost is sufficient for my use-case, not sure however there aren't others. |
I actually think it is good practice to expose the An actual trusted certificate is not practical: leaving aside the question of what hostname it should be issued to, CAs do not allow public distribution of certificates they issue, and they will revoke them when irregularities are detected. I created a package called |
Never thought about this but that makes sense to expose the |
Hello everyone! First of all, thanks for making available this great library. I'm working on an Elixir version of the Mechanize library (https://github.com/gushonorato/mechanizex) and I'm really missing bypass support to HTTPS. Does anyone know if it's hard to make bypass work with HTTPS? Maybe I can submit a patch if anyone could give me some directions. |
Yeah, supporting HTTPS properly would be a pretty big deal for us! |
I had a call with @MSch today about this, and we both think that supporting SSL in bypass would be an overkill for now. The idea imho behind bypass is to test THAT a request was made, not HOW the request was made. Is there any lib that does NOT work with only HTTP? |
Some security libs that require use of https, such as https://github.com/tanguilp/oauth2_metadata_updater for instance. However, using Tesla and its mocking abilities is a good alternative. |
I learned about this issue from a recent blog post by @danschultzer where he talks about an alternative tool he built: https://danschultzer.com/posts/testserver-mock-third-party-services |
oidcc gets upset |
Hello! First of all I'd like to say I really like and appreciate Bypass!!! However, I'm running into an issue I'm having trouble resolving. I have a test that makes an
https
scheme outbound request using Bypass, which gives me this error:The error is a little confusing because the headers I have are:
When I change the outbound request scheme to
http
, the tests pass and no error is raisedIt appears that Bypass is not intended to make
https
outbound requests, and I'm wondering if that is the case, or if there is some sort of configuration I am missing?Thank you in advance for your help!!!
The text was updated successfully, but these errors were encountered: