-
Notifications
You must be signed in to change notification settings - Fork 59
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
Allow https metadata without credentials #67
Conversation
@@ -77,6 +77,8 @@ private string GetMetadata(out Version edmxVersion) | |||
} | |||
} | |||
|
|||
ServicePointManager.ServerCertificateValidationCallback += new System.Net.Security.RemoteCertificateValidationCallback((s, ce, ch, ssl) => true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this meant for test/development environment only, or have you encountered issues outside of the development process?
In either case, we should add some guards inside the lambda. We should add a boolean such as isDevelopment which returns true as presented in your code. We should also add validation when isDevelopment == false. I would also recommend using more descriptive variable names. Below is my comprehensive suggestion:
ServicePointManager.ServerCertificateValidationCallback +=
new System.Net.Security.RemoteCertificateValidationCallback((sender, certificate, chain, sslPolicyErrors) =>
{
if (isDevelopment)
{
return true;
}
if (sslPolicyErrors == System.Net.Security.SslPolicyErrors.None)
{
return true;
}
// Do not allow this client to communicate with unauthenticated servers.
return false;
});
The isDevelopment
would be a represented as a checkbox in the UI that you can add in ODataConnectedService/src/Views/AdvancedSettings.xaml
. You would have to bind that checkbox with the boolean.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great start. Let's add some validations to it.
He has deleted this repository |
Closing this PR due to contributor's repo deletion. |
Just open the link in Internet explorer, will prompt for username and password. Then save the credentials. Try again in visual studio. It works!!! |
Issue 56