Uploaded image for project: 'Modules'
  1. Modules
  2. MODULES-7176

IIS : Sites created on Port 443 are not created with HTTPS protocol

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: iis, windows
    • Labels:
    • Template:
      MODULES Bug Template
    • Acceptance Criteria:
      Hide

      A site created with a 443 port binding should not fail.

      The acceptance test suite should test for this use case.

      Show
      A site created with a 443 port binding should not fail. The acceptance test suite should test for this use case.
    • Epic Link:
    • Team:
      Windows
    • Sprint:
      Windows 2019-02-20
    • Method Found:
      Customer Feedback
    • QA Risk Assessment:
      Needs Assessment

      Description

      When a site is created in a manifest with the port set to 443, the call to the New-Website cmdlet does not use the -SSL flag to create the site with the HTTPS Protocol enabled. This causes the attempt to start the site to fail.

      Desired Behavior: A site created with a port binding of 443 should create, and start as expected.

      Actual Behavior: The site is created and then fails when puppet attempts to start the site.

      Notice below that the parameters in the @creatparams variable do not include the -ssl switch param. This is required for a run like this to succeed.

      Failed Run Log Output:

      [0;36mDebug: "C:\ProgramData\PuppetLabs\puppet\cache\lib\puppet_x\templates\iis\init_ps.ps1"[0m
      [0;36mDebug: 2018-05-14 07:27:32 -0500 C:\windows\system32\WindowsPowershell\v1.0\powershell.exe -NoProfile -NonInteractive -NoLogo -ExecutionPolicy Bypass is running as pid: 7684[0m
      [0;36mDebug: 2018-05-14 07:27:33 -0500 PowerShell initialization complete for pid: 7684[0m
      [0;36mDebug: Waited 0.0 total seconds.[0m
      [0;36mDebug: COMMAND: If (Test-Path -Path 'IIS:\sites\puppet_site') { exit 0 } else { exit 255 }[0m
      [0;36mDebug: Waited 0.0 total seconds.[0m
      [0;36mDebug: COMMAND: 
      $resource = @{
        name            = 'puppet_site'
        ensure          = 'started'
        physicalpath    = 'd:\inetpub\wwwroot'
        applicationpool = 'puppet_site_pool'
      }
      $createParams = @{
        Name            = $resource.name
        PhysicalPath    = $resource.physicalpath
        ApplicationPool = $resource.applicationpool
        Force           = $true
        ErrorAction     = 'Stop'
          port            = 443
          HostHeader      = ''
      }
      # If there are no other websites, specify the Id, otherwise an Index Out of Range error can be thrown
      If ((Get-ChildItem 'IIS:\sites' | Measure-Object).Count -eq 0) {
        $createParams['Id'] = 1
      }
      # create website
      # dont set applicationpool if it doesnt exist
      New-Website @createParams
      [0m
      [0;36mDebug: Waited 0.0 total seconds.[0m
      [0;36mDebug: STDOUT: 
      Name             ID   State      Physical Path                  Bindings                                               
      ----             --   -----      -------------                  --------                                               
      puppet_site      1    Stopped    d:\inetpub\wwwroot             http *:443:                                            
      [0m
      [0;36mDebug: COMMAND: If (Test-Path -Path 'IIS:\sites\puppet_site') { exit 0 } else { exit 255 }[0m
      [0;36mDebug: Waited 0.0 total seconds.[0m
      [0;36mDebug: COMMAND: Start-Website -Name "puppet_site" -ErrorVariable errvar;if($errvar){ throw "$($errvar). Perhaps there is another website with this port or configuration setting" }[0m
      [0;36mDebug: Waited 0.0 total seconds.[0m
      [0;36mDebug: STDOUT: Start-Website : Cannot create a file when that file already exists. (Exception from HRESULT: 0x800700B7)
      At line:1 char:1
      + Start-Website -Name "puppet_site" -ErrorVariable errvar;if($errvar){  ...
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : InvalidOperation: (:) [Start-Website], COMException
          + FullyQualifiedErrorId : InvalidOperation,Microsoft.IIs.PowerShell.Provider.StartWebsiteCommand
      [0m
      [0;36mDebug: ERRMSG: Cannot create a file when that file already exists. (Exception from HRESULT: 0x800700B7). Perhaps there is another website with this port or configuration setting

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              william.hurt William Hurt
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support