How to , and other stuff about linux, photo, php … A linux, photography blog. To remember some linux situation, and fix them quickly.

August 30, 2017

httpd with multiple ssl and password for every key automatically

Filed under: Linux — Tags: , , , , — admin @ 1:19 pm

Well to use this we must use the SSLPassPhraseDialog functionality of httpd – apache .

Basically into ssl.conf we put this line or modify the existing one into

SSLPassPhraseDialog exec:/path/script

Where script is read/execute only by root.

And the script is

 

#!/bin/perl
$server = $ARGV[0];
#print $server;
if ($server eq ‘www.example.com:443’ || $server eq ‘www.example2.com:443’ ) {
print ‘password one’;
} elsif ($server eq ‘example3.com’) {
print ‘Password two’;
}

 

Powered by WordPress