Graphql-Client ruby OpenSSL::SSL::SSLError

396 views Asked by At

I am trying to test if I can connect to a graphql API from a rails backend by using graphql-client with the following code:

require "graphql/client"
require "graphql/client/http"

HTTP = GraphQL::Client::HTTP.new("https://x.x.x.x:3100/graphql") 

Schema = GraphQL::Client.load_schema(HTTP)

Client = GraphQL::Client.new(schema: Schema, execute: HTTP)

but I get the following error:

    9: from db/seeds.rb:14:in `<main>'
    8: from /Library/Ruby/Gems/2.6.0/gems/graphql-client-0.16.0/lib/graphql/client.rb:61:in `load_schema'
    7: from /Library/Ruby/Gems/2.6.0/gems/graphql-client-0.16.0/lib/graphql/client.rb:77:in `dump_schema'
    6: from /Library/Ruby/Gems/2.6.0/gems/graphql-client-0.16.0/lib/graphql/client/http.rb:73:in `execute'
    5: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/net/http.rb:1470:in `request'
    4: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/net/http.rb:919:in `start'
    3: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/net/http.rb:930:in `do_start'
    2: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/net/http.rb:996:in `connect'
    1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/net/protocol.rb:44:in `ssl_socket_connect'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/net/protocol.rb:44:in `connect_nonblock': SSL_connect returned=1 errno=0 state=SSLv3 read server hello A: wrong version number (OpenSSL::SSL::SSLError)

SSL_connect returned=1 errno=0 state=SSLv3 read server hello A: wrong version number (OpenSSL::SSL::SSLError)

I have no idea how to get that solved as when I look that error up it is always in different situation than mine.

0

There are 0 answers