Skip to content

Using docker - Connecting to MYSQL via SSL? #3003

Answered by dgw
icsy7867 asked this question in Q&A
Discussion options

You must be logged in to vote

Best I can tell, connecting to a database over SSL/TLS (still) requires adding a "must-use" plugin in user/db.php. See #2783 for the discussion, but the gist is something like (modify with your own certificate path):

<?php
/*
Plugin Name: Secure MySQL
Plugin URI: https://github.com/YOURLS/YOURLS/issues/2783
Description: SSL/TLS PDO Connection
Version: 1.0
Author: YOURLS
Author URI: https://yourls.org/
*/
// No direct call
if( !defined( 'YOURLS_ABSPATH' ) ) die();

// Add custom cert
yourls_add_filter( 'db_connect_driver_option', function ( $options ) {
    // Add your certificate paths
    // https://secure.php.net/manual/ref.pdo-mysql.php
    return $options + [ PDO::MYSQL_ATTR_SSL_CA => '…

Replies: 2 comments 17 replies

Comment options

You must be logged in to vote
17 replies
@icsy7867
Comment options

@LeoColomb
Comment options

@icsy7867
Comment options

@icsy7867
Comment options

@icsy7867
Comment options

Answer selected by LeoColomb
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants