mirror of
https://github.com/ProxymanApp/Proxyman.git
synced 2026-04-27 09:05:54 +03:00
[GH-ISSUE #682] "SSL handshake failed" error after setting https_proxy variable in terminal for CLI usage #677
Labels
No labels
Discussion
Feature request
In Progress...
Plugins
Waiting response
Windows
Windows
bug
duplicate
enhancement
feature
good first issue
iOS
macOS 10.11
question
wontfix
✅ Done
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/Proxyman#677
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @djpowers on GitHub (Nov 11, 2020).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/682
Originally assigned to: @NghiaTranUIT on GitHub.
Proxyman version? (Ex. Proxyman 1.4.3)
2.11.1
macOS Version? (Ex. mac 10.14)
10.15.7
Steps to reproduce
export https_proxy=http://127.0.0.1:9090(approach copied from this comment, fixing presumed typo in IP address)Proxyman shows:
And directed me to the SSL Error from HTTPS Request/Response troubleshooting page. (I am able to successfully see HTTPS responses when visiting
https://google.com.)Rails console shows:
Expected behavior
Request is shown in Proxyman with response viewable.
This might be outside the scope of Proxyman, but it seems that Ruby is not detecting the certificate for some reason.
Any help you're able to provide is appreciated.
@NghiaTranUIT commented on GitHub (Nov 11, 2020):
If you're able to see HTTPS response from https://google.com, it means the problem comes from your Rail App.
Some libraries need a config to tell Rail app trusts Proxyman self-signed certificate since they're not using Apple Keychain's Trust Store.
For example, Java Virtual Machine doesn't use KeyChain, so I have to manually install it.
For Ruby and Rails, let me google it 😄
@NghiaTranUIT commented on GitHub (Nov 11, 2020):
I found some tutorials:
rails s -b 'ssl://127.0.0.1:3000?key=config/ssl/localhost.ross.key&cert=config/ssl/localhost.ross.crt'(https://rossta.net/blog/local-ssl-for-rails-5.html#trust-the-certificate)Basically, I googled how to use self-signed certificate or disable SSL Verification from Rail app.
Please let me know if it works.
@djpowers commented on GitHub (Nov 12, 2020):
Thank you so much for the prompt reply and investigation!
The answer in the first option worked for me (adding
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONEto a file in config/initializers, along with settinghttps_proxyin the terminal).The others options appear to be intended for when running the Rails server, but the Rails console does not accept the
--binding=IPflag so I'm not sure if they would be the best solution for that use case.@NghiaTranUIT commented on GitHub (Nov 12, 2020):
Glad to know that it works for you 👍 I will update the Troubleshooting to let other users know how to fix 😄
@djpowers commented on GitHub (Nov 12, 2020):
Also I'm not sure how it works under the hood, but I noticed that HTTP Toolkit has a clever way of Intercepting HTTP from Node.js and other command line tools by setting environmental variables & overrides. It would be great if Proxyman could implement something similar to avoid the need for changes to the code.
Either way, thanks again for the help! Feel free to close out this issue if that makes sense to you.
@NghiaTranUIT commented on GitHub (Nov 12, 2020):
Thanks for the hint. I will check out to see how this tool can do it automatically 👍
@djpowers commented on GitHub (Apr 29, 2022):
Closing this out to help clean up the open issues.
In case someone (or future me) stumbles upon this, the initializer step is no longer necessary. See the Ruby docs page for the current solution (the provided environment variable can be set from within the Rails console).