OpenSSL Hızlı Referans Kılavuzu
Bu kılavuz, OpenSSL kullanarak sertifika yönetimi, anahtar oluşturma, TLS testleri ve diğer güvenlik işlemleri için temel komutları sunar. OpenSSL, açık kaynak SSL/TLS protokolü kütüphanesi ve araç setidir.
Sürüm ve Yardım
Yüklü OpenSSL sürümünü kontrol edin ve komut yardımı alın.
| Komut | Açıklama |
|---|---|
openssl version |
OpenSSL sürümünü gösterir |
openssl version -a |
Derleme detayları ve yollarını gösterir |
openssl help |
Mevcut komutları listeler |
openssl req -help |
req komutu için yardım gösterir |
openssl x509 -help |
Sertifika denetimi için yardım gösterir |
Özel Anahtarlar
RSA ve eliptik eğri özel anahtarları oluşturun.
| Komut | Açıklama |
|---|---|
openssl genrsa -out private.key 2048 |
RSA özel anahtarı oluşturur |
openssl genrsa -out private.key 4096 |
Daha büyük RSA anahtarı oluşturur |
openssl genrsa -aes256 -out private.key 2048 |
Şifreli RSA anahtarı oluşturur |
openssl rsa -in encrypted.key -out plain.key |
Anahtar şifresini kaldırır |
openssl ecparam -name prime256v1 -genkey -noout -out ec.key |
EC özel anahtarı oluşturur |
chmod 600 private.key |
Anahtar izni sınırlar |
Özel anahtarları her zaman güvenli bir şekilde saklayın ve erişim iznini sınırlayın.
Sertifika İmzalanma Talebi
Sertifika yetkilileri için CSR'ler oluşturun.
| Komut | Açıklama |
|---|---|
openssl req -new -newkey rsa:2048 -noenc -keyout domain.key -out domain.csr |
Anahtar ve CSR oluşturur |
openssl req -new -key domain.key -out domain.csr |
Mevcut anahtardan CSR oluşturur |
openssl req -new -newkey rsa:2048 -noenc -keyout domain.key -out domain.csr -subj "/CN=example.com" |
Etkileşimsiz CSR |
openssl req -new -key domain.key -out domain.csr -addext "subjectAltName=DNS:example.com,DNS:www.example.com" |
SAN isimleri ile CSR |
openssl req -in domain.csr -noout -text |
CSR içeriğini denetler |
openssl req -in domain.csr -noout -subject |
CSR konusunu yazdırır |
Kendi İmzalı Sertifikalar
Yerel ve iç sertifikalar oluşturun.
| Komut | Açıklama |
|---|---|
openssl req -x509 -newkey rsa:2048 -noenc -keyout selfsigned.key -out selfsigned.crt -days 365 |
Kendi imzalı sertifika oluşturur |
openssl req -x509 -new -key domain.key -out domain.crt -days 365 |
Mevcut anahtarla kendi imzalı oluşturur |
openssl req -x509 -newkey rsa:2048 -noenc -keyout localhost.key -out localhost.crt -days 365 -subj "/CN=localhost" -addext "subjectAltName=DNS:localhost,IP:127.0.0.1" |
SAN ile yerel sertifika |
openssl x509 -in selfsigned.crt -noout -text |
Sertifika denetimi |
openssl x509 -in selfsigned.crt -noout -dates |
Geçerlilik tarihlerini gösterir |
Sertifika Denetimi
Sertifika alanlarını tarayıcı açmadan okuyun.
| Komut | Açıklama |
|---|---|
openssl x509 -in cert.crt -noout -text |
Sertifika detaylarını gösterir |
openssl x509 -in cert.crt -noout -subject |
Konuyu gösterir |
openssl x509 -in cert.crt -noout -issuer |
Yayınlayıcıyı gösterir |
openssl x509 -in cert.crt -noout -dates |
Geçerlilik tarihlerini gösterir |
openssl x509 -in cert.crt -noout -serial |
Sıra numarasını gösterir |
openssl x509 -in cert.crt -noout -fingerprint -sha256 |
SHA-256 parmağını gösterir |
Anahtar, CSR ve Sertifika Uyumu
Dağıtım öncesi dosyaların uyumunu doğrulayın.
| Komut | Açıklama |
|---|---|
openssl rsa -in domain.key -noout -modulus | openssl md5 |
RSA anahtar modulusunu hashler |
openssl x509 -in domain.crt -noout -modulus | openssl md5 |
Sertifika modulusunu hashler |
openssl req -in domain.csr -noout -modulus | openssl md5 |
CSR modulusunu hashler |
openssl pkey -in private.key -pubout -outform pem |
Özel anahtardan kamu anahtarı çıkarır |
openssl x509 -in domain.crt -pubkey -noout |
Sertifikadan kamu anahtarı çıkarır |
Format Dönüşümü
Sertifikaları yaygın kodlamalar arasında dönüştürün ve paketleyin.
| Komut | Açıklama |
|---|---|
openssl x509 -in cert.pem -outform der -out cert.der |
PEM sertifikasını DER'e dönüştürür |
openssl x509 -in cert.der -inform der -out cert.pem |
DER sertifikasını PEM'e dönüştürür |
openssl pkcs12 -export -out bundle.pfx -inkey domain.key -in domain.crt |
PKCS#12 paketini oluşturur |
openssl pkcs12 -in bundle.pfx -out bundle.pem -noenc |
PKCS#12'den PEM çıkarır |
openssl rsa -in private.key -outform der -out private.der |
RSA anahtarı DER'e dönüştürür |
TLS Bağlantı Testi
Canlı TLS hizmetlerini s_client ile hata ayıklayın.
| Komut | Açıklama |
|---|---|
openssl s_client -connect example.com:443 -servername example.com |
HTTPS ile SNI test edin |
openssl s_client -connect mail.example.com:993 -servername mail.example.com |
IMAPS TLS test edin |
openssl s_client -starttls smtp -connect mail.example.com:587 -servername mail.example.com |
SMTP STARTTLS test edin |
echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null | openssl x509 -noout -dates |
Uzak sertifika tarihlerini gösterir |
openssl s_client -connect example.com:443 -tls1_3 |
TLS 1.3 zorlar |
openssl s_client -connect example.com:443 -showcerts |
Sertifika zincirini gösterir |
Rasgele Veri ve Hash
Tokenlar oluşturun ve dosya sömürüleri doğrulayın.
| Komut | Açıklama |
|---|---|
openssl rand -base64 32 |
Base64 token oluşturur |
openssl rand -hex 32 |
Hex token oluşturur |
openssl dgst -sha256 file.iso |
SHA-256 dosya hash |
openssl dgst -sha512 file.iso |
SHA-512 dosya hash |
openssl dgst -sha256 -binary file.iso | openssl base64 |
Base64-encoded ikili sömürü |
İlgili Kılavuzlar
Sertifika iş akışları için bu referansları kullanın.
| Kılavuz | Açıklama |
|---|---|
| OpenSSL Komut Kılavuzu | Tam OpenSSL eğitimi ve örnekler |
| Kendi İmzalı SSL Sertifikası Oluşturma | Adım adım kendi imzalı sertifika kılavuzu |
| SSL Sertifikası nedir? | SSL/TLS sertifika kavramları |
| dig Komutu | Sertifika testinden önce DNS'yi denetleyin |

