Skip to content

Exception The remote certificate is invalid according to the validation procedure #2

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

Closed
mzaatar opened this issue Nov 19, 2020 · 3 comments

Comments

@mzaatar
Copy link

mzaatar commented Nov 19, 2020

Hey,
Thanks for providing another library for connecting to Snowflake.

There is an issue with GetHostName method in AuthInfo.cs, I failed to use it due to this exception:
Unhandled exception. System.AggregateException: One or more errors occurred. (The SSL connection could not be established, see inner exception.)
---> System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.
---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.

Do you think we need to change this to be return $"{Account}.snowflakecomputing.com"; or at least make the Hostname parameter that we can set in the ctor same as account and user etc.

@fixer-m
Copy link
Owner

fixer-m commented Nov 19, 2020

Hi,
Thanks for your bug report!

How your URL looks like when you are logged-in into Snowflake web interface? (You can strip out your account name)

I suppose this issue is related to SSL certificate settings.
Official client enforces TLS 1.2 but Snowflake.Client don't - and I think it might be required for some regions.

Can you please prepend your code with these lines (before using Snowflake.Client):

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
ServicePointManager.UseNagleAlgorithm = false;
ServicePointManager.CheckCertificateRevocationList = true;

And check if it solves the issue?

@fixer-m
Copy link
Owner

fixer-m commented Feb 6, 2021

@mzaatar, do you still have this issue?

@fixer-m
Copy link
Owner

fixer-m commented Feb 18, 2021

@mzaatar, I'm closing this since there is no response for a long time.
If you still have this issue, you can open new issue. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants