1
0
mirror of https://github.com/vrana/adminer.git synced 2025-09-03 03:13:00 +02:00

PostgreSQL: Allow to set connection's sslmode with AdminerLoginSsl plugin

Thanks to wodka (https://github.com/vrana/adminer/pull/427/files)
This commit is contained in:
Peter Knut
2024-09-17 17:56:12 +02:00
parent 353cd452a3
commit e4e76b6384
3 changed files with 64 additions and 38 deletions

View File

@@ -1,24 +1,28 @@
<?php
/** Connect to MySQL using SSL
* @link https://www.adminer.org/plugins/#use
* @author Jakub Vrana, https://www.vrana.cz/
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
class AdminerLoginSsl {
/** @access protected */
var $ssl;
/**
* @param array array("key" => filename, "cert" => filename, "ca" => filename)
*/
function __construct($ssl) {
/**
* Connect to MySQL using SSL
*
* @link https://www.adminer.org/plugins/#use
* @author Jakub Vrana, https://www.vrana.cz/
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
class AdminerLoginSsl
{
private var $ssl;
/**
* MySQL: ["key" => filename, "cert" => filename, "ca" => filename]
* PostgresSQL: ["mode" => sslmode] (https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNECT-SSLMODE)
*/
function __construct(array $ssl)
{
$this->ssl = $ssl;
}
function connectSsl() {
function connectSsl()
{
return $this->ssl;
}
}