0

我正在尝试使用以下代码测试是否可以从rails后端连接到 graphql API:graphql-client

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)

但我收到以下错误:

    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)

我不知道如何解决这个问题,因为当我查看该错误时,它总是处于与我不同的情况。

4

0 回答 0