Skip to content

Commit f88e524

Browse files
authored
Merge pull request #4 from Sire/claude/update-readme-tag-011CUN7xTsXu7AR8gdzk7Hqd
Update README: document TLS options and .NET 8.0 upgrade
2 parents aca7f1f + c90bd2e commit f88e524

File tree

1 file changed

+47
-2
lines changed

1 file changed

+47
-2
lines changed

README.md

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Ping a SQL Server. For example to test connectivity through a firewall, testing a failover cluster or testing permissions.
44

5-
This is a .NET console app and should run fine on [all supported operating systems](https://github.com/dotnet/core/blob/main/release-notes/7.0/supported-os.md): Windows, Linux and macOS.
5+
This is a .NET console app and should run fine on [all supported operating systems](https://github.com/dotnet/core/blob/main/release-notes/8.0/supported-os.md): Windows, Linux and macOS.
66

77
## USAGE:
88
SQLPing <Server> [OPTIONS]
@@ -20,8 +20,12 @@ This is a .NET console app and should run fine on [all supported operating syste
2020
-c, --command SQL Command (default will return database information)
2121
-f, --failover This is a failover cluster / availability group, use MultiSubnetFailover=true
2222
-a, --failoverpartner Use a custom failover partner
23-
-n, --nonstop Set this to true to continously ping the server. Default is ping once
23+
-n, --nonstop Set this to true to continuously ping the server. Default is ping once
2424
-w, --wait <SECONDS> 10 How long to wait, in seconds, between non-stop pings
25+
--encrypt <VALUE> true Encryption mode: true|false|strict
26+
-T, --trust-server-certificate Trust server certificate without validation (DEV ONLY)
27+
-H, --hostname-in-certificate Override hostname for TLS certificate validation
28+
--no-tnir Disable TransparentNetworkIPResolution
2529

2630
## SECURITY NOTES:
2731

@@ -58,6 +62,47 @@ SQLPing myserver -u myusername -p mypassword
5862
- Always prefer environment variables or interactive prompts for production use
5963
- Connection strings in output have passwords redacted automatically
6064

65+
## TLS/ENCRYPTION OPTIONS:
66+
67+
### Connection Encryption
68+
69+
By default, SQL Server connections use encryption. You can control this behavior with the following options:
70+
71+
**--encrypt <true|false|strict>**
72+
- `true` (default): Encrypted connection with certificate validation
73+
- `false`: No encryption (not recommended for production)
74+
- `strict`: Strictest encryption mode (requires SQL Server 2022+)
75+
76+
**-T, --trust-server-certificate**
77+
- For development/testing environments only
78+
- Bypasses certificate validation but maintains encryption
79+
- WARNING: Vulnerable to man-in-the-middle attacks in production
80+
81+
**-H, --hostname-in-certificate <name>**
82+
- Override the expected hostname in the server's TLS certificate
83+
- Useful when connecting via IP address but certificate contains a specific hostname
84+
- Must match the Subject Alternative Name (SAN) or CN in the server's certificate
85+
86+
**--no-tnir**
87+
- Disables TransparentNetworkIPResolution
88+
- Prevents automatic hostname-to-IP substitution that can break TLS name matching
89+
- Recommended when using `--hostname-in-certificate`
90+
91+
### Examples
92+
93+
```bash
94+
# Connect with strict encryption (SQL Server 2022+)
95+
SQLPing myserver -u myuser --encrypt strict
96+
97+
# Development: connect via IP with self-signed certificate
98+
SQLPing 10.0.0.5 -u myuser -T --hostname-in-certificate sqlserver.local
99+
100+
# Production: connect via IP with valid certificate, specify expected hostname
101+
SQLPing 10.0.0.5 -u myuser -H sqlserver.company.com --no-tnir
102+
103+
# Disable encryption (not recommended)
104+
SQLPing myserver -u myuser --encrypt false
105+
```
61106

62107
# Todo
63108

0 commit comments

Comments
 (0)