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

OpenSSL Error: 1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version #4618

Closed
nchapman opened this issue Jun 24, 2017 · 8 comments

Comments

@nchapman
Copy link

I'm seeing errors when connecting to certain sites over https such as:

Here's some code the produces the error for me:

require "http/client"

# also happens with https://www.forbes.com/
response = HTTP::Client.get "https://www.usatoday.com/"

This is the error that I get when I run it:

~ crystal ssl_error.cr
SSL_connect: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version (OpenSSL::SSL::Error)
0x10e691815: *CallStack::unwind:Array(Pointer(Void)) at ??
0x10e6917b1: *CallStack#initialize:Array(Pointer(Void)) at ??
0x10e691788: *CallStack::new:CallStack at ??
0x10e68dd61: *raise<OpenSSL::SSL::Error>:NoReturn at ??
0x10e72ada3: *OpenSSL::SSL::Socket::Client#initialize<TCPSocket, OpenSSL::SSL::Context::Client, Bool, String>:Nil at ??
0x10e72acbc: *OpenSSL::SSL::Socket::Client::new:context:sync_close:hostname<TCPSocket, OpenSSL::SSL::Context::Client, Bool, String>:OpenSSL::SSL::Socket::Client at ??
0x10e71d6e1: *HTTP::Client#socket:(OpenSSL::SSL::Socket+ | TCPSocket+) at ??
0x10e71d43b: *HTTP::Client#exec_internal_single<HTTP::Request>:(HTTP::Client::Response | Nil) at ??
0x10e71aeec: *HTTP::Client#exec_internal<HTTP::Request>:HTTP::Client::Response at ??
0x10e71ade2: *HTTP::Client#exec<HTTP::Request>:HTTP::Client::Response at ??
0x10e71ab4d: *HTTP::Client#exec<String, String, Nil, Nil>:HTTP::Client::Response at ??
0x10e71a54a: *HTTP::Client::exec<String, String, Nil, Nil, Nil>:HTTP::Client::Response at ??
0x10e71a2df: *HTTP::Client::get<String>:HTTP::Client::Response at ??
0x10e67c74e: __crystal_main at ??
0x10e68ce88: main at ??

I'm running macOS 10.12.5 and have crystal installed via brew:

~ brew info crystal-lang
crystal-lang: stable 0.22.0 (bottled), HEAD
Fast and statically typed, compiled language with Ruby-like syntax
https://crystal-lang.org/
/usr/local/Cellar/crystal-lang/0.22.0 (789 files, 58.7MB) *
  Poured from bottle on 2017-06-23 at 23:54:55
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/crystal-lang.rb
==> Dependencies
Build: pkg-config ✔, libatomic_ops ✘
Required: libevent ✔, bdw-gc ✔, llvm ✔, pcre ✔, gmp ✔, libyaml ✔

Any help would be greatly appreciated! Thanks!

@benoist
Copy link
Contributor

benoist commented Jun 24, 2017

Looks like an issue with openssl or the ssl config of the servers itself.

openssl s_client -connect www.usatoday.com:443

Returns

CONNECTED(00000003)
62789:error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version:/BuildRoot/Library/Caches/com.apple.xbs/Sources/OpenSSL098/OpenSSL098-64.50.6/src/ssl/s23_clnt.c:593:

@benoist
Copy link
Contributor

benoist commented Jun 24, 2017

Yep, OSx version is broken. The homebrew version works as expected

brew install openssl
crystal your-file.cr --link-flags '-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib'

@sdogruyol
Copy link
Member

Can we close this?

@RX14 RX14 closed this as completed Sep 10, 2017
@Eliasgr11
Copy link

Hi, I'm using Xcode version 7.0
I'm studying iOS programming, I'm trying to create a repository and I received this error:
SSL Error: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version (-1)

does somebody help to me saying what should I do? thanks

@mav-inv-tech
Copy link

Try updating your git installation! This happened on an old computer that was running < 2.0

@il-bianco
Copy link

Hi, I'm having the same problem.
I'm running git version 2.3.5.
If I try this command
openssl s_client -connect www.usatoday.com:443
it works fine.

@jhass
Copy link
Member

jhass commented Feb 27, 2018

Hey folks, this is not a general Github nor git support forum, this is the issue tracker for the Crystal programming language hosted on Github.

@ysbaddaden
Copy link
Contributor

Let's lock.

@crystal-lang crystal-lang locked as resolved and limited conversation to collaborators Feb 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants