Чтобы создать самоподписанный сертификат, создайте каталог только для этого и выполните следующую команду:
openssl req -newkey rsa:2048 -nodes -keyout key.key -x509 -days 365 -out certificate.crt
Эта команда выше создаст 2048-битный сертификат RSA, действительный в течение 365 дней. Я не уверен, есть ли что-то особенное в sni, кроме того, что вы используете общий IP-адрес. И, чтобы настроить его, используйте виртуальные хосты, основанные на имени, за дополнительной информацией обращайтесь к https://cwiki.apache.org/confluence/display/HTTPD/NameBasedSSLVHostsWithSNI.
В основном он настроен так:
<VirtualHost 1.2.3.4:80>
ServerAdmin email@example1.com
ServerName example1.com #This says that if the ip is accessed through example1.com, display the document root for example1.com, and take all the config from this virtualhost
DocumentRoot /path/to/document/root/for/example1.com
</VirtualHost>
<VirtualHost 1.2.3.4:80>
ServerAdmin email@example2.com
ServerName example2.com #This says that if the ip is accessed through example1.com, display the document root for example2.com, and take all the config from this virtualhost
DocumentRoot /path/to/document/root/for/example2.com
</VirtualHost>