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 PowerShell to connect using TLS 1.2 #1249
Conversation
By default powershell does not connect via TLS 1.2. Allow it if it isn't already configured.
Thanks for working on this fix @seeplusplus. Please take a look at the Contributor's guide since there are some steps you have to take before we can consider your pull request, like signing the contributor's agreement and opening a SERVER ticket. Thanks, |
Thanks for your reply, I'm not familiar with MongoDB's contribution process, so I attempted to follow your instructions. The ticket is open at, Edit: Updated link |
|
||
# Default PowerShell SecurityProtocol does not support Tls1.2 (required by domain) | ||
if ([Net.ServicePointManager]::SecurityProtocol.ToString() -NotMatch "Tls12") { | ||
[Net.ServicePointManager]::SecurityProtocol += [Net.SecurityProtocolType]::Tls12 |
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.
You need to just set the SecurityProtocol to Tls12, you can't "add it" it throws the following error:
Method invocation failed because [System.Net.SecurityProtocolType] doesn't contain a method named 'op_Addition'.
At Z:\mongo\src\mongo\installer\compass\Install-Compass.ps1:36 char:9
+ [Net.ServicePointManager]::SecurityProtocol += [Net.SecurityProtocolType ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (op_Addition:String) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : MethodNotFound
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.
I've made the change requested.
I also apologize for doing this work on master, as I was unfamiliar with the work process for mongo. Would you prefer me to resubmit under a branch with the usual naming convention for Mongo PRs or is this fine as is?
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.
This is fine as is, most of us work off master anyway.
I'm going to do some manual testing on this fix but I don't see any reason it wouldn't work. Thanks for your help we appreciate you taking care of this for us.
Set value instead of appending - append not supported in some environments.
This is merged with 9b93595 Thanks for the PR @seeplusplus ! |
By default powershell does not connect via TLS 1.2. Allow it if it isn't already configured.
This fixes an issue where checking "Install Compass" on the MongoDB installer does not install compass on Windows machines.