Различия
Здесь показаны различия между двумя версиями данной страницы.
Предыдущая версия справа и слева Предыдущая версия Следующая версия | Предыдущая версия | ||
abills:docs:manual:admin_cert_auth [2011/01/17 12:48] pigich |
abills:docs:manual:admin_cert_auth [2015/12/05 17:50] (текущий) |
||
---|---|---|---|
Строка 14: | Строка 14: | ||
serial = $dir/serial # The current serial number | serial = $dir/serial # The current serial number | ||
#crlnumber = $dir/crlnumber # the current crl number must be | #crlnumber = $dir/crlnumber # the current crl number must be | ||
- | # commented out to leave a V1 CRL | + | # commented out to leave а V1 CRL |
crl = $dir/CA/ca.crl # The current CRL | crl = $dir/CA/ca.crl # The current CRL | ||
private_key = $dir/CA/ca.key # The private key | private_key = $dir/CA/ca.key # The private key | ||
Строка 95: | Строка 95: | ||
- | cd /usr/abills/Certs/ | + | cd /usr/abills/Certs/ && mkdir {CA,server,user} |
- | mkdir CA | + | |
- | mkdir server | + | |
- | mkdir user | + | |
- | + | ||
echo "01" > serial | echo "01" > serial | ||
touch index.txt | touch index.txt | ||
- | **Стоврюємо сертифікат організації** | + | **Создаем сертификат организации** |
- | Стоврюємо ключ і самопідписаний СА сертифікат | + | Создаем ключ и самподписанный СА сертификат |
- | openssl genrsa –rand /var/log/messages -out ./CA/ca.key -camellia256 2048 | + | openssl genrsa – rand /var/log/messages -out ./CA/ca.key -camellia256 2048 |
| | ||
openssl req -new -key ./CA/ca.key -out ./CA/ca.csr | openssl req -new -key ./CA/ca.key -out ./CA/ca.csr | ||
Строка 112: | Строка 109: | ||
openssl x509 -req -signkey ./CA/ca.key -in ./CA/ca.csr -extfile /etc/ssl/openssl.cnf -out ./CA/ca.crt | openssl x509 -req -signkey ./CA/ca.key -in ./CA/ca.csr -extfile /etc/ssl/openssl.cnf -out ./CA/ca.crt | ||
- | Перевірка | + | Проверка |
openssl x509 -in ca.crt -text | openssl x509 -in ca.crt -text | ||
- | **Тепер стоврюємо сертифікат сервера** | + | **Теперь создаем сертификат сервера** |
openssl genrsa -rand /var/log/messages -out ./server/freebsd.local.com.key -camellia256 2048 | openssl genrsa -rand /var/log/messages -out ./server/freebsd.local.com.key -camellia256 2048 | ||
- | COMMON NAME вводимо **ДНС ім'я серверу** | + | COMMON NAME вводим **ДНС имя серверу** |
- | Пароль той самий що і для приватного ключа freebsd.local.com.key | + | Пароль тот же что и для частного ключа freebsd.local.com.key |
openssl req -new -key ./server/freebsd.local.com.key -config /etc/ssl/openssl.cnf -out ./server freebsd.local.com.csr | openssl req -new -key ./server/freebsd.local.com.key -config /etc/ssl/openssl.cnf -out ./server freebsd.local.com.csr | ||
- | і підписуємо його сертифікатом організації | + | и подписываем его сертификатом организации |
openssl ca -in ./server/freebsd.local.com.csr -cert ./CA/ca.crt -keyfile ./CA/ca.key -out ./server/freebsd.local.com.crt -config /etc/ssl/openssl.cnf -days 365 | openssl ca -in ./server/freebsd.local.com.csr -cert ./CA/ca.crt -keyfile ./CA/ca.key -out ./server/freebsd.local.com.crt -config /etc/ssl/openssl.cnf -days 365 | ||
- | **Стоврюємо сертифікат клієнта** | + | **Создаем сертификат клиента** |
openssl genrsa -rand /var/log/messages -out ./user/client.key -camellia256 2048 | openssl genrsa -rand /var/log/messages -out ./user/client.key -camellia256 2048 | ||
Строка 134: | Строка 131: | ||
openssl req -new -key /user/client.key -out ./user/client.csr | openssl req -new -key /user/client.key -out ./user/client.csr | ||
- | і підписуємо його сертифікатом організації | + | и подписываем его сертификатом организации |
openssl ca -in ./user/client.csr -cert ./CA/ca.crt -keyfile ./CA/ca.key -out ./user/client.crt -extensions client -config /etc/ssl/openssl.cnf | openssl ca -in ./user/client.csr -cert ./CA/ca.crt -keyfile ./CA/ca.key -out ./user/client.crt -extensions client -config /etc/ssl/openssl.cnf | ||
- | Експортуємо в формат читаємий IE, Mozilla ,... | + | Экспортируем в формат читаємий IE, Mozilla... |
openssl pkcs12 -export -clcerts -in ./user/client.crt -inkey ./user/client.key -out ./user/client.p12 | openssl pkcs12 -export -clcerts -in ./user/client.crt -inkey ./user/client.key -out ./user/client.p12 | ||
- | або | + | или |
openssl pkcs12 -export -clcerts -in ./user/certificates/client.crt -inkey ./user/keys/client.key -out ./user/certificates/client.p12 -name "test certificate" | openssl pkcs12 -export -clcerts -in ./user/certificates/client.crt -inkey ./user/keys/client.key -out ./user/certificates/client.p12 -name "test certificate" | ||
- | Копіюємо файл client.p12 на комп'ютер клієнта | + | Копируем файл client.p12 на компьютер клиента |
- | Редагуємо конфіг /usr/abills/misc/apache/abills_httpd.conf | + | Редактируем конфиг /usr/abills/misc/apache/abills_httpd.conf |
- | Вставляємо між <IfModule ssl_module> </IfModule ssl_module> | + | Вставляем между <IfModule ssl_module> </IfModule ssl_module> |
<Location /admin> | <Location /admin> | ||
Строка 155: | Строка 152: | ||
</Location> | </Location> | ||
- | Змінюємо шлях до сертифікатів | + | Изменяем путь к сертификатам |
SSLCertificateFile /usr/abills/Certs/server/freebsd.local.com.crt | SSLCertificateFile /usr/abills/Certs/server/freebsd.local.com.crt | ||
Строка 161: | Строка 158: | ||
SSLCACertificateFile /usr/abills/Certs/CA/ca.crt | SSLCACertificateFile /usr/abills/Certs/CA/ca.crt | ||
| | ||
- | Перезапускаємо веб-сервер | + | Перезапускаем веб сервер |
| | ||
/usr/local/etc/rc.d/apache22 restart | /usr/local/etc/rc.d/apache22 restart | ||
- | дивимось лог помилок | + | смотрим лог ошибок |
- | **Добавляємо сертифікат на стороні клієнта** | + | **Добавляем сертификат на стороне клиента** |
- | Для для роботи в Internet Explorer, GoogleChrome запускаємо freebsd.local.com.p12 | + | Для для работы в Internet Explorer, GoogleChrome запускаем freebsd.local.com.p12 |
- | Для Mozilla FireFox | + | Для Mozilla FireFox |
{{http://abills.net.ua/img/1mozilla.jpg?380x200}} | {{http://abills.net.ua/img/1mozilla.jpg?380x200}} | ||
+ | \\ | ||
{{http://abills.net.ua/img/2mozilla.jpg?380x200}} | {{http://abills.net.ua/img/2mozilla.jpg?380x200}} | ||
+ | Дополнительные ссылки по авторизации с помощью сертификатов | ||
+ | http://www.linuxconfig.org/apache-web-server-ssl-authentication \\ | ||
+ | http://www.cafesoft.com/products/cams/ps/docs30/admin/ConfiguringApache2ForSSLTLSMutualAuthentication.html \\ | ||
+ | http://www.symantec.com/connect/articles/apache-2-ssltls-step-step-part-3 \\ | ||