Skip to content

Commit 815e38c

Browse files
committed
chore: update ssl connection readme
1 parent 0355dca commit 815e38c

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

README.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ docker run --rm --init \
113113

114114
```bash
115115
# PostgreSQL example
116-
npx @bytebase/dbhub --transport sse --port 8080 --dsn "postgres://user:password@localhost:5432/dbname"
116+
npx @bytebase/dbhub --transport sse --port 8080 --dsn "postgres://user:password@localhost:5432/dbname?sslmode=disable"
117117
```
118118

119119
```bash
@@ -175,6 +175,38 @@ npx @bytebase/dbhub --transport sse --port 8080 --demo
175175

176176
## Usage
177177

178+
### SSL Connections
179+
180+
You can specify the SSL mode using the `sslmode` parameter in your DSN string:
181+
182+
| sslmode | `disable` | `sslmode=require` | Default SSL Behavior |
183+
|------------|:----------------:|:----------------:|:-------------------:|
184+
| PostgreSQL ||| Certificate verification |
185+
| MySQL ||| Certificate verification |
186+
| MariaDB ||| Certificate verification |
187+
| SQL Server ||| Built-in encryption |
188+
| SQLite ||| N/A (file-based) |
189+
| Oracle ||| Built-in encryption |
190+
191+
**SSL Mode Options:**
192+
193+
- `sslmode=disable`: All SSL/TLS encryption is turned off. Data is transmitted in plaintext.
194+
- `sslmode=require`: Connection is encrypted, but the server's certificate is not verified. This provides protection against packet sniffing but not against man-in-the-middle attacks.
195+
196+
Without specifying `sslmode`, most databases default to certificate verification, which provides the highest level of security.
197+
198+
Example usage:
199+
```bash
200+
# Disable SSL
201+
postgres://user:password@localhost:5432/dbname?sslmode=disable
202+
203+
# Require SSL without certificate verification
204+
postgres://user:password@localhost:5432/dbname?sslmode=require
205+
206+
# Standard SSL with certificate verification (default)
207+
postgres://user:password@localhost:5432/dbname
208+
```
209+
178210
### Read-only Mode
179211

180212
You can run DBHub in read-only mode, which restricts SQL query execution to read-only operations:

0 commit comments

Comments
 (0)