Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

seeplusplus
Copy link
Contributor

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.

By default powershell does not connect via TLS 1.2. Allow it if it isn't already configured.
@markbenvenuto
Copy link
Contributor

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,
Mark

@seeplusplus
Copy link
Contributor Author

seeplusplus commented Jul 1, 2018

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,
https://jira.mongodb.org/browse/SERVER-35936
anything else needed on my end?

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
Copy link
Contributor

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

Copy link
Contributor Author

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?

Copy link
Contributor

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.
@chasinglogic
Copy link
Contributor

chasinglogic commented Jul 23, 2018

This is merged with 9b93595

Thanks for the PR @seeplusplus !

chasinglogic pushed a commit that referenced this pull request Dec 18, 2018
Set value instead of appending - append not supported in some
environments.

Closes #1249

Signed-off-by: Mathew Robinson <chasinglogic@gmail.com>
(cherry picked from commit 9b93595)
chasinglogic pushed a commit that referenced this pull request Dec 28, 2018
Set value instead of appending - append not supported in some
environments.

Closes #1249

Signed-off-by: Mathew Robinson <chasinglogic@gmail.com>
(cherry picked from commit 9b93595)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants