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

Added special char trimming for ssl and updated help texts #3724

Merged
merged 2 commits into from
Mar 3, 2017

Conversation

asranja
Copy link
Contributor

@asranja asranja commented Mar 3, 2017

No description provided.

@@ -226,7 +226,11 @@ function Trim-Inputs([ref]$siteName, [ref]$physicalPath, [ref]$poolName, [ref]$v
}
if ($sslCertThumbPrint -ne $null)
{
$sslCertThumbPrint.Value = $sslCertThumbPrint.Value.Trim()
# Trim all non-hexadecimal characters from the ssl cetificate thumbprint
Write-Warning (Get-VstsLocString -Key "SSLCertWarningInvalidCharacters")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

write warning only when there are non-hexadecimal characters

@@ -627,7 +627,8 @@
"InvalidVirtualPath": "Virtual path should begin with a /",
"InvalidIISDeploymentType": "Invalid IIS Deployment Type : {0}",
"InvalidActionIISWebsite": "Invalid action '{0}' selected for the IIS Website.",
"InvalidActionIISAppPool": "Invalid action '{0}' selected for the IIS Application Pool."
"InvalidActionIISAppPool": "Invalid action '{0}' selected for the IIS Application Pool.",
"SSLCertWarningInvalidCharacters": "SSL Certificate thumbprint contains non-hexadecimal characters. Trimming all non-hexadecimal characters."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it will be good to add a forward link to documentation here and help-markdown https://msdn.microsoft.com/en-us/library/windows/desktop/cc307220(v=vs.85).aspx

Write-Warning (Get-VstsLocString -Key "SSLCertWarningInvalidCharacters")
$sslCertThumbprint.Value = [Regex]::Replace($sslCertThumbprint.Value, "[^a-fA-F0-9]+" , "")
$sslCertThumbprintValue = $sslCertThumbprint.Value
Write-Host "##vso[task.setvariable variable=sslCertThumbprint;isSecret=true]$sslCertThumbprintValue"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the variable name may collide. How about using a GUID?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a comment to convey the intent

@asranja asranja merged commit daac898 into master Mar 3, 2017
@bryanmacfarlane bryanmacfarlane deleted the users/asranja/sslandpasswordhelptext branch January 31, 2018 00:28
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

Successfully merging this pull request may close these issues.

3 participants