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
Error: SecureChannelFailure (The authentication or decryption has failed.) #1034
Comments
Adding here, that from the client point of view (the auto generated client), it could be a System.Net.ServicePointManager.ServerCertificateValidationCallback +=
delegate (object sender, System.Security.Cryptography.X509Certificates.X509Certificate certificate,
System.Security.Cryptography.X509Certificates.X509Chain chain,
System.Net.Security.SslPolicyErrors sslPolicyErrors)
{
return true; // **** Always accept
};
ServicePointManager.ServerCertificateValidationCallback = MyRemoteCertificateValidationCallback; where public bool MyRemoteCertificateValidationCallback(System.Object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
{
bool isOk = true;
// If there are errors in the certificate chain, look at each error to determine the cause.
if (sslPolicyErrors != SslPolicyErrors.None)
{
for (int i = 0; i < chain.ChainStatus.Length; i++)
{
if (chain.ChainStatus[i].Status != X509ChainStatusFlags.RevocationStatusUnknown)
{
chain.ChainPolicy.RevocationFlag = X509RevocationFlag.EntireChain;
chain.ChainPolicy.RevocationMode = X509RevocationMode.Online;
chain.ChainPolicy.UrlRetrievalTimeout = new TimeSpan(0, 1, 0);
chain.ChainPolicy.VerificationFlags = X509VerificationFlags.AllFlags;
bool chainIsValid = chain.Build((X509Certificate2)certificate);
if (!chainIsValid)
{
isOk = false;
}
}
}
}
return isOk;
} should bypass the problem, while it does not solve it. See here for more details about it. |
This issue was moved to swagger-api/swagger-codegen#3505 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have generated the
C#
and theC# .NET 2.0
clients, the I did the build to get thedll
in the bin folder.As soon as I put this in a Xamarin Android example project and I do a
http
call I get this error:I'm not sure if this is related to
mono
or to the way the swagger auto generated client is usingTLS
in the http module, since the calls are overhttps
.The text was updated successfully, but these errors were encountered: