Skip to content

Commit 46e49c6

Browse files
committed
Windows install one-liner: force TLS 1.2 so users reach the OS gate (marcpope#274)
Server 2012 / 2012 R2 and Win 7/8/8.1 ship with PowerShell defaults that use TLS 1.0/1.1. A modern BBS server rejects those at the SSL handshake, so 'iwr' fails before our install-windows.ps1 script (and its marcpope#274 OS gate) ever runs. The user sees 'The request was aborted: Could not create SSL/TLS secure channel' instead of the friendly 'unsupported Windows version' message that explains what to do. Adding the SecurityProtocol line to the one-liner before iwr forces TLS 1.2 in the calling PowerShell session. .NET 4.5+ (which ships with Server 2012 and later) supports the Tls12 enum value, so this runs cleanly on every OS we'd want to gate. Modern Windows is unaffected — they already default to TLS 1.2.
1 parent 7121866 commit 46e49c6

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/Views/clients/detail.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3123,7 +3123,14 @@ function update() {
31233123
<div class="tab-pane fade" id="install-windows" role="tabpanel">
31243124
<div class="card border-0 shadow-sm">
31253125
<div class="card-body">
3126-
<?php $winCmd = "powershell -ExecutionPolicy Bypass -Command \"& {iwr -UseBasicParsing '{$appUrl}/api/agent/download?file=install-windows.ps1' -OutFile \$env:TEMP\\bbs-install.ps1; & \$env:TEMP\\bbs-install.ps1 -Server '{$appUrl}' -Key '{$agent['api_key']}'}\""; ?>
3126+
<?php
3127+
// PowerShell on pre-2016 Windows defaults to TLS 1.0/1.1 — modern BBS
3128+
// servers reject those, so `iwr` would fail before our script's OS gate
3129+
// even runs. Forcing TLS 1.2 here lets the user reach the friendly
3130+
// "unsupported OS" message inside the script (#274) rather than seeing
3131+
// an opaque SSL/TLS handshake error from PowerShell.
3132+
$winCmd = "powershell -ExecutionPolicy Bypass -Command \"& {[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; iwr -UseBasicParsing '{$appUrl}/api/agent/download?file=install-windows.ps1' -OutFile \$env:TEMP\\bbs-install.ps1; & \$env:TEMP\\bbs-install.ps1 -Server '{$appUrl}' -Key '{$agent['api_key']}'}\"";
3133+
?>
31273134
<div class="d-flex justify-content-between align-items-center mb-2">
31283135
<p class="mb-0">Run this command in an <strong>Administrator</strong> Command Prompt or PowerShell:</p>
31293136
<button class="btn btn-sm btn-outline-secondary" type="button"

0 commit comments

Comments
 (0)