|
112 | 112 | </li> |
113 | 113 | </ul> |
114 | 114 | </li> |
| 115 | + <li class="toctree-l3"><a class="reference internal" href="#ssltls-configuration">SSL/TLS Configuration</a> |
| 116 | + <ul> |
| 117 | + <li class="toctree-l4"><a class="reference internal" href="#ssl-settings">SSL Settings</a> |
| 118 | + </li> |
| 119 | + <li class="toctree-l4"><a class="reference internal" href="#ssl-mode-mapping">SSL Mode Mapping</a> |
| 120 | + </li> |
| 121 | + <li class="toctree-l4"><a class="reference internal" href="#example-ssl-with-certificate-verification">Example: SSL with Certificate Verification</a> |
| 122 | + </li> |
| 123 | + <li class="toctree-l4"><a class="reference internal" href="#example-ssl-without-verification">Example: SSL without Verification</a> |
| 124 | + </li> |
| 125 | + <li class="toctree-l4"><a class="reference internal" href="#backwards-compatibility-note">Backwards Compatibility Note</a> |
| 126 | + </li> |
| 127 | + </ul> |
| 128 | + </li> |
115 | 129 | </ul> |
116 | 130 | </li> |
117 | 131 | <li class="toctree-l2"><a class="reference internal" href="../sqlite/">SQLite</a> |
@@ -441,6 +455,13 @@ <h2 id="configuration-steps">Configuration Steps</h2> |
441 | 455 | 'charset' => 'UTF8', // PostgreSQL uses uppercase charset names |
442 | 456 | 'file' => '', // Not used for PostgreSQL |
443 | 457 | 'debug' => false, // Set to true to see SQL queries for debugging |
| 458 | + |
| 459 | + // SSL/TLS Settings (optional, added in 4.1.0) |
| 460 | + 'ssl' => false, // Enable SSL/TLS connection |
| 461 | + 'ssl_verify' => false, // Verify server certificate (requires ssl=true) |
| 462 | + 'ssl_ca' => '', // Path to CA certificate file (sslrootcert) |
| 463 | + 'ssl_key' => '', // Path to client private key (sslkey) |
| 464 | + 'ssl_cert' => '', // Path to client certificate (sslcert) |
444 | 465 | ], |
445 | 466 |
|
446 | 467 | // Other configuration sections remain the same as in settings.defaults.php |
@@ -482,6 +503,101 @@ <h3 id="performance-tuning">Performance Tuning</h3> |
482 | 503 | <p><strong>Statement Timeout</strong>: For web applications, consider setting <code>statement_timeout</code> to prevent long-running queries</p> |
483 | 504 | </li> |
484 | 505 | </ol> |
| 506 | +<h2 id="ssltls-configuration">SSL/TLS Configuration</h2> |
| 507 | +<p><em>Added in version 4.1.0</em></p> |
| 508 | +<p>Poweradmin supports SSL/TLS encrypted connections to PostgreSQL servers using the <code>sslmode</code> DSN parameter.</p> |
| 509 | +<h3 id="ssl-settings">SSL Settings</h3> |
| 510 | +<table> |
| 511 | +<thead> |
| 512 | +<tr> |
| 513 | +<th>Setting</th> |
| 514 | +<th>Description</th> |
| 515 | +<th>Default</th> |
| 516 | +</tr> |
| 517 | +</thead> |
| 518 | +<tbody> |
| 519 | +<tr> |
| 520 | +<td><code>ssl</code></td> |
| 521 | +<td>Enable SSL/TLS connection</td> |
| 522 | +<td><code>false</code></td> |
| 523 | +</tr> |
| 524 | +<tr> |
| 525 | +<td><code>ssl_verify</code></td> |
| 526 | +<td>Verify server certificate (requires <code>ssl=true</code>)</td> |
| 527 | +<td><code>false</code></td> |
| 528 | +</tr> |
| 529 | +<tr> |
| 530 | +<td><code>ssl_ca</code></td> |
| 531 | +<td>Path to CA certificate file (sslrootcert)</td> |
| 532 | +<td>Empty</td> |
| 533 | +</tr> |
| 534 | +<tr> |
| 535 | +<td><code>ssl_key</code></td> |
| 536 | +<td>Path to client private key (sslkey)</td> |
| 537 | +<td>Empty</td> |
| 538 | +</tr> |
| 539 | +<tr> |
| 540 | +<td><code>ssl_cert</code></td> |
| 541 | +<td>Path to client certificate (sslcert)</td> |
| 542 | +<td>Empty</td> |
| 543 | +</tr> |
| 544 | +</tbody> |
| 545 | +</table> |
| 546 | +<h3 id="ssl-mode-mapping">SSL Mode Mapping</h3> |
| 547 | +<p>Poweradmin maps the settings to PostgreSQL <code>sslmode</code> values:</p> |
| 548 | +<table> |
| 549 | +<thead> |
| 550 | +<tr> |
| 551 | +<th>ssl</th> |
| 552 | +<th>ssl_verify</th> |
| 553 | +<th>PostgreSQL sslmode</th> |
| 554 | +</tr> |
| 555 | +</thead> |
| 556 | +<tbody> |
| 557 | +<tr> |
| 558 | +<td><code>false</code></td> |
| 559 | +<td>-</td> |
| 560 | +<td><code>prefer</code> (try SSL, fall back to non-SSL)</td> |
| 561 | +</tr> |
| 562 | +<tr> |
| 563 | +<td><code>true</code></td> |
| 564 | +<td><code>false</code></td> |
| 565 | +<td><code>require</code> (require SSL, no cert verification)</td> |
| 566 | +</tr> |
| 567 | +<tr> |
| 568 | +<td><code>true</code></td> |
| 569 | +<td><code>true</code></td> |
| 570 | +<td><code>verify-full</code> (require SSL + verify cert + hostname)</td> |
| 571 | +</tr> |
| 572 | +</tbody> |
| 573 | +</table> |
| 574 | +<h3 id="example-ssl-with-certificate-verification">Example: SSL with Certificate Verification</h3> |
| 575 | +<pre><code class="language-php">'database' => [ |
| 576 | + 'type' => 'pgsql', |
| 577 | + 'host' => 'postgres.example.com', |
| 578 | + 'port' => '5432', |
| 579 | + 'user' => 'poweradmin', |
| 580 | + 'password' => 'your_password', |
| 581 | + 'name' => 'powerdns', |
| 582 | + 'ssl' => true, |
| 583 | + 'ssl_verify' => true, |
| 584 | + 'ssl_ca' => '/path/to/ca-cert.pem', |
| 585 | +], |
| 586 | +</code></pre> |
| 587 | +<h3 id="example-ssl-without-verification">Example: SSL without Verification</h3> |
| 588 | +<pre><code class="language-php">'database' => [ |
| 589 | + 'type' => 'pgsql', |
| 590 | + 'host' => 'postgres.example.com', |
| 591 | + 'port' => '5432', |
| 592 | + 'user' => 'poweradmin', |
| 593 | + 'password' => 'your_password', |
| 594 | + 'name' => 'powerdns', |
| 595 | + 'ssl' => true, |
| 596 | + 'ssl_verify' => false, |
| 597 | +], |
| 598 | +</code></pre> |
| 599 | +<h3 id="backwards-compatibility-note">Backwards Compatibility Note</h3> |
| 600 | +<p>By default (<code>ssl=false</code>), Poweradmin uses <code>sslmode=prefer</code>, which attempts SSL connections but falls back to non-SSL if the server doesn't support it. This maintains backwards compatibility with existing configurations.</p> |
485 | 601 |
|
486 | 602 |
|
487 | 603 | </div> |
|
0 commit comments