Open acolchagoff opened 9 years ago
+1 I get the same issue locally, though it works on heroku.
I've run rvm osx-ssl-certs update all
and my certs are up to date.
@denodster figured it out, its a problem with your openssl configuration, not mixpanel specifically.
To see the problem, try this code with any https url as the endpoint
, e.g. https://www.google.com, and it'll return a certificate error:
require 'net/https'
endpoint = 'https://api.mixpanel.com'
uri = URI(endpoint)
request = Net::HTTP::Get.new(uri.request_uri)
client = Net::HTTP.new(uri.host, uri.port)
client.use_ssl = true
client.open_timeout = 2
client.continue_timeout = 10
client.read_timeout = 10
client.ssl_timeout = 2
response = client.request(request)
puts response.code
puts response.body
This doc explains a few ways to fix it. Force linking openssl might work but might cause problems. So I ran the following which updates apple's version of openssl that is installed by default, and it all just worked.
brew tap raggi/ale
brew install openssl-osx-ca
openssl-osx-ca
Yeah I can confirm that this is sorted out. Thanks all.
Thanks for pointing this out @denodster, and thanks for investigating @ddgromit!
to improve the Google Fu of this (closed but still relevant) issue, I'll post my full error message:
#<Mixpanel::ConnectionError: Could not connect to Mixpanel, with error "SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed".>
@ddgromit's 3-line solution worked for me. Remember to spring stop
if you're using Spring!
I still have this issue. Tried everything in this thread. I also tried @ddgromit sample code with another https
url to see and it did not return an error. But with mixpanel https
url i get the error. My certs are up to date.
Anyone have an idea?
Also have this issue, tried @ddgromit and nothing doing. It seems to be only recent for me.
+1
I also have this problem... ðŸ˜
Sorry for the silence everyone, I am looking into this I have not been able to reproduce. In the meantime can you let me know how you are using the ruby gem in your stack so that I can try to repro?
Even if this is not a bug in the gem, It might be helpful if the return was something other than just 'false' when a failure occurs.
I also have this issue, tried all the workarounds and still nothing.
+1
This is one way of turning things off locally:
# config/initializers/mixpanel.rb
if Rails.env.development?
# silence local SSL errors
Mixpanel.config_http do |http|
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
end
end
@avk +1
i have the same issue. i'm using @avk 's patch for the time being
@avk's patch does work but is there an official fix for this in the works?
+1 struggling with this for ages
+1
Thank you @avk for the work around.
Another thanks to @avk for the workaround.
Thanks @avk! Fixed.
+1 struggling with this for ages
thanks @ddgromit
I'm trying to add Mixpanel to our back end and do a call to the people.set endpoint.
My call looks like this:
In all my testing, res is simply 'false'
I used my debugger to dig into the gem a little bit and I'm finding that there is a connection error exception thrown on line 100 of consumer.rb:
I don't have any trouble making calls to the mixpanel api using javascript, so I think my machine is configured fine, also this is my local machine so my server will have a different environment.