TLS alert: 'HandshakeFailure' #99
Replies: 4 comments 3 replies
-
It seems like an issue with your environment. I will move this issue into discussions and if you can share more details about the error we may help you. |
Beta Was this translation helpful? Give feedback.
-
hi there: |
Beta Was this translation helpful? Give feedback.
-
Do you have any more detail, a stack trace maybe? I will try to add ignore Certificate Errors option to the library. |
Beta Was this translation helpful? Give feedback.
-
Could you try this code on your server, if it works I will add an option for ignoring the cert error. var clientHandler = new HttpClientHandler();
clientHandler.ServerCertificateCustomValidationCallback = (sender, cert, chain, sslPolicyErrors) => true;
var client = new HttpClient(clientHandler);
var options = Options.Create<OpenAiOptions>(new OpenAiOptions()
{
ApiKey = Environment.GetEnvironmentVariable("MY_OPEN_AI_API_KEY")!
});
var openAIService = new OpenAIService(client, options); |
Beta Was this translation helpful? Give feedback.
-
Hi,this is code piece
public async Task GetAnswer(string text)
{
When I am running it on my server, it returns an error : Authentication failed because the remote party sent a TLS alert: 'HandshakeFailure'.
When I am running it on local pc,it runs ok.
I have checked the setting of TLS between server and local pc, they are the same each other.
btw,I can get normally response from openai.com’s playground on server.
thank you.
Beta Was this translation helpful? Give feedback.
All reactions