Self-Signed certificat

Below a little script to generate the certificate self-signed for your secure web server (https):

#!/bin/bash
#
# make_new_www_selfcert.sh
#
SERVER=your.fqnd.domain
SSLDIR=/etc/ssl
SSLAPACHEDIR=/etc/apache2/ssl
SSLDATE=365
openssl req -config $SSLDIR/openssl.cnf -new -x509 -days $SSLDATE -sha1 -newkey rsa:1024 -keyout $SSLAPACHEDIR/$SERVER.key -out $SSLAPACHEDIR/$SERVER.crt -subj '/C=your_country/ST=your_state/L=your_location/O=your_compagny_name/OU=your_department/CN=your.fqdn.domain/emailAddress=your_email@fqdn.domain'

usage:

  • put this script where you want your certificates (i.e. /etc/apache2/ssl)
  • modify SERVER and -subj option with your values
  • run: bash make_new_selfcert.sh
  • chmod 400 /etc/apache2/ssl/$SERVER.* to protect your key and cert

This create 2 files named SERVER.key and SERVER.crt in the current location.

Entrées correspondantes:
VaudTax sous Linux
Gentoo: access violation summary
Flash Player 9 pour Linux
Gentoo on my T60p
Debian key update
Commentaires (0) Permalink