2017-09-09 18 views
1

だった私はNodeJS + ExpressJS + MongoDBの中に書かれたgraphqlサーバーを持っている、と私は細かいことで次の変異を実行することができます。シンプルgraphqlクライアント - 基になる接続が閉じられたエラー

enter image description here

を私は、C#デスクトップアプリケーションでgraphql APIを使用する必要があります。私はテスターを実行すると

var client = new SimpleGraphQLClient("https://tweetserver.dynamic-dns.net/graphql"); 

var query = @" 
    mutation { 
     signup(
      email: $email 
      fullName: $fullName 
      password: $password 
      avatar: $avatar 
      username: $username 
     ) { 
      token 
     } 
    } 
"; 

dynamic signup = client.Execute(query, new 
{ 
    email = "[email protected]", 
    fullName = "Test User", 
    password = "123456", 
    avatar = "https://randomuser.me/api/portraits/women/0.jpg", 
    username = "testuser3" 
}); 

if (signup != null && signup.error == null) 
{ 
    Console.WriteLine((string)signup.token); 
} 
else 
{ 
    Console.WriteLine("Error - {0}", signup.error); 
} 

、私が手に:私はこのようにそれを使用

https://github.com/latheesan-k/simple-graphql-client/blob/master/SimpleGraphQLClient/SimpleGraphQLClient.cs

:だから、私はこのようになりますC#で簡単なGraphQLクライアントを作成することを決定しました次のエラー:

Error - The underlying connection was closed: An unexpected error occurred on a send.

は、私が(最初のスクリーンショットを参照)ことを目的としてgraphql APIエンドポイントが有効で働いている知っている:

https://tweetserver.dynamic-dns.net/graphql https://tweetserver.dynamic-dns.net/graphiql

間違っているかもしれないものの任意のアイデア?

答えて

0

私はそれを理解したと思います。私はLetsEncrypt無料SSLとhttps://cipherli.stからのnginxのルールを使用していて、RestSharpを介して私のC#graphqlクライアントからの接続を拒否したNginX(リバースプロキシはssl +ルールを実行していました)でした。

がエラーを修正するには、あなたは自分のアプリにこれを追加する必要があります。

ServicePointManager.SecurityProtocol = 
    SecurityProtocolType.Tls12 | 
    SecurityProtocolType.Tls11 | 
    SecurityProtocolType.Tls; 
関連する問題