{"id":13337969,"url":"https://github.com/zekiunal/openssl-certificate-authority-guide","last_synced_at":"2026-01-28T20:41:51.769Z","repository":{"id":79633058,"uuid":"96995514","full_name":"zekiunal/openssl-certificate-authority-guide","owner":"zekiunal","description":"Bu kılavuz, OpenSSL komut satırı araçlarını kullanarak kendi sertifika yetkilinizi (CA) kurup nasıl kullanacağınızı gösterir. ","archived":false,"fork":false,"pushed_at":"2017-08-12T17:19:26.000Z","size":26,"stargazers_count":19,"open_issues_count":1,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-23T20:11:26.900Z","etag":null,"topics":["certificate-authority","openssl","security","tls","turkce","turkish"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc-by-sa-4.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zekiunal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-12T10:29:13.000Z","updated_at":"2024-10-03T18:30:03.000Z","dependencies_parsed_at":"2023-03-01T09:00:28.650Z","dependency_job_id":null,"html_url":"https://github.com/zekiunal/openssl-certificate-authority-guide","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zekiunal%2Fopenssl-certificate-authority-guide","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zekiunal%2Fopenssl-certificate-authority-guide/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zekiunal%2Fopenssl-certificate-authority-guide/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zekiunal%2Fopenssl-certificate-authority-guide/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zekiunal","download_url":"https://codeload.github.com/zekiunal/openssl-certificate-authority-guide/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243000831,"owners_count":20219751,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["certificate-authority","openssl","security","tls","turkce","turkish"],"created_at":"2024-07-29T19:15:16.576Z","updated_at":"2026-01-28T20:41:51.734Z","avatar_url":"https://github.com/zekiunal.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"--------------------------\n**Disclaimer:** non-English version of the guide contain unofficial translations contributed by our users. They are not binding in any way, are not guaranteed to be accurate, and have no legal effect. The official text is the [English](https://jamielinux.com/docs/openssl-certificate-authority/) version of the website.\n\n--------------------------\n\n# OpenSSL Sertifika Yetkilisi\n\nBu kılavuz, OpenSSL komut satırı araçlarını kullanarak kendi sertifika yetkilinizi (CA) nasıl kurup kullanacağınızı gösterir. Kendi adınıza hizmet veren sertifika yetkilisi, intranet web sitesini güvence altına almak için sunucu sertifikaları verebilir veya bir sunucuya kimlik doğrulaması yapmalarını sağlamak için müşterilere sertifikalar üretebilir. Sertifika yetkilisi buna benzer birçok durumda kullanışlı bir çözümdür.\n\n\u003cdetails\u003e\n\n# OpenSSL Certificate Authority\n\nThis guide demonstrates how to act as your own certificate authority (CA) using the OpenSSL command-line tools. This is useful in a number of situations, such as issuing server certificates to secure an intranet website, or for issuing certificates to clients to allow them to authenticate to a server.\n\n[source](https://jamielinux.com/docs/openssl-certificate-authority/)\n[discourse](https://discourse.jamielinux.com/)\n\n\u003c/details\u003e\n\n## Giriş\n\nOpenSSL, dijital sertifikaları işleme için çeşitli komut satırı araçları sağlayan ücretsiz ve açık kaynak kodlu bir kütüphanedir. Bu araçlardan bazıları bir sertifika yetkilisi olarak kullanılabilir.\n\nBir sertifika yetkilisi (CA), dijital sertifikaları imzalayan bir oteritedir. Çoğu web sitesi, müşterilerine bağlantılarının güvenli olduğunu bildirme ihtiyacı duyar, bu nedenle alan adları için bir sertifika imzalamak istediklerinde uluslararası geçerliliğe sahip (örneğin, VeriSign, DigiCert) bir sertifika yetkilisine (CA'ya)  ödeme yaparlar.\n\nBazı durumlarda DigiCert gibi bir sertifika yetkilisine (CA'ya) ödeme yapmak yerine kendi sunucularımızdan birini sertifika yetkilisi (CA'ya) gibi göstermek daha mantıklı olabilir. Bu durumlar genellikle, bir intranet web sitesinin güvenliğini sağlamak veya bir sunucuya kimlik doğrulamasını yapmayı sağlamak için müşterilere sertifikalar (örn., Apache, OpenVPN) üretmek olabilir.\n\n\u003cdetails\u003e\n\n## Introduction\n\nOpenSSL is a free and open-source cryptographic library that provides several command-line tools for handling digital certificates. Some of these tools can be used to act as a certificate authority.\n\nA certificate authority (CA) is an entity that signs digital certificates. Many websites need to let their customers know that the connection is secure, so they pay an internationally trusted CA (eg, VeriSign, DigiCert) to sign a certificate for their domain.\n\nIn some cases it may make more sense to act as your own CA, rather than paying a CA like DigiCert. Common cases include securing an intranet website, or for issuing certificates to clients to allow them to authenticate to a server (eg, Apache, OpenVPN).\n\n\u003c/details\u003e\n\n## Anahtar Çiftinin Oluşturulması\n\nBir sertifika yetkilisi (CA) olarak hareket etmek demek, Özel anahtar  ve genel sertifika çiftlerinin şifrelenmesiyle uğraşmak anlamına gelir. Oluşturacağımız ilk şifreleme çifti, kök çiftidir. Bu, kök anahtardan (root key) (ca.key.pem) ve kök sertifikadan (root certificate) (ca.cert.pem) oluşur. Bu çift, CA'nızın kimliğini oluşturur.\n\nGenellikle kök CA, sunucu veya istemci sertifikalarını doğrudan imzalamaz. Kök CA yalnızca kök CA tarafından kendi adına sertifikalar imzalamaya güvendiği bir veya daha fazla Ara (intermediate) CA oluşturmada kullanılır. Bu en iyi ve en yaygın uygulamadır. Kök anahtara herhangi bir zararlı erişim felakete yol açacağından, kök anahtarının çevrimdışı tutulmasına ve kullanılmamasına izin verir.\n\n\u003e Not : Kök çiftini güvenli bir ortamda oluşturmak en iyi yöntemdir. İdeal olarak, bu ortam, Internet'ten kalıcı olarak izole edilmiş tamamen şifreli, `air gap` bir bilgisayarda olmalıdır. Kablosuz kartı çıkarın ve ethernet bağlantı noktasını tutkalla doldurun.\n\n\u003cdetails\u003e\n\n## Create the root pair\n\nActing as a certificate authority (CA) means dealing with cryptographic pairs of private keys and public certificates. The very first cryptographic pair we’ll create is the root pair. This consists of the root key (ca.key.pem) and root certificate (ca.cert.pem). This pair forms the identity of your CA.\n\nTypically, the root CA does not sign server or client certificates directly. The root CA is only ever used to create one or more intermediate CAs, which are trusted by the root CA to sign certificates on their behalf. This is best practice. It allows the root key to be kept offline and unused as much as possible, as any compromise of the root key is disastrous.\n\n\u003e Note: It’s best practice to create the root pair in a secure environment. Ideally, this should be on a fully encrypted, air gapped computer that is permanently isolated from the Internet. Remove the wireless card and fill the ethernet port with glue.\n\n\u003c/details\u003e\n\n### Dizinlerin Hazırlanması \n\nTüm anahtarları ve sertifikaları saklamak için bir dizin seçin (`/root/ca`).\n\n```\nmkdir /root/ca\n```\n\nDizin yapısı oluşturun. `index.txt` ve` serial` dosyaları, imzalı sertifikaları takip etmek için düz bir dosyadır ve veritabanı görevi görürler.\n\n```\ncd /root/ca\nmkdir certs crl newcerts private\nchmod 700 private\ntouch index.txt\necho 1000 \u003e serial\n```\n\n\u003cdetails\u003e\n\n### Prepare the directory\n\nChoose a directory (`/root/ca`) to store all keys and certificates.\n\n```\nmkdir /root/ca\n```\n\nCreate the directory structure. The `index.txt` and `serial` files act as a flat file database to keep track of signed certificates.\n\n```\ncd /root/ca\nmkdir certs crl newcerts private\nchmod 700 private\ntouch index.txt\necho 1000 \u003e serial\n```\n\n\u003c/details\u003e\n\n### Yapılandırma Dosyasını Hazırlayın\n\nOpenSSL'in kullanması için bir yapılandırma dosyası oluşturmanız gerekir. Kök CA yapılandırma dosyasını [Ekler](#)'den `/root/ca/openssl.cnf` dosyasına kopyalayın.\n\n`[ca]` bölümü zorunludur. Burada OpenSSL'e `[CA_default]` bölümündeki seçenekleri kullanmasını söylüyoruz.\n\n```\n[ ca ]\n# `man ca`\ndefault_ca = CA_default\n```\n\n`[CA_default]` bölümü bir dizi öntanımlı değer içerir. Daha önce belirlediğiniz dizini işaret ettiğinden emin olun (`/root/ca`).\n\n```\n[ CA_default ]\n# Directory and file locations.\ndir               = /root/ca\ncerts             = $dir/certs\ncrl_dir           = $dir/crl\nnew_certs_dir     = $dir/newcerts\ndatabase          = $dir/index.txt\nserial            = $dir/serial\nRANDFILE          = $dir/private/.rand\n\n# The root key and root certificate.\nprivate_key       = $dir/private/ca.key.pem\ncertificate       = $dir/certs/ca.cert.pem\n\n# For certificate revocation lists.\ncrlnumber         = $dir/crlnumber\ncrl               = $dir/crl/ca.crl.pem\ncrl_extensions    = crl_ext\ndefault_crl_days  = 30\n\n# SHA-1 is deprecated, so use SHA-2 instead.\ndefault_md        = sha256\n\nname_opt          = ca_default\ncert_opt          = ca_default\ndefault_days      = 375\npreserve          = no\npolicy            = policy_strict\n```\n\nKök CA yalnızca ara CA'lar (intermediate CA) oluşturmak için kullanıldığından, tüm kök CA imzaları için `policy_strict` uygularız.\n\n```\n[ policy_strict ]\n# The root CA should only sign intermediate certificates that match.\n# See the POLICY FORMAT section of `man ca`.\ncountryName             = match\nstateOrProvinceName     = match\norganizationName        = match\norganizationalUnitName  = optional\ncommonName              = supplied\nemailAddress            = optional\n```\n\nAra CA, üçüncü taraflardan gelebilecek sunucu ve istemci sertifikaları imzalarken, tüm ara CA imzaları için policy_loose kuralları uygulanacaktır.\n\n```\n[ policy_loose ]\n# Allow the intermediate CA to sign a more diverse range of certificates.\n# See the POLICY FORMAT section of the `ca` man page.\ncountryName             = optional\nstateOrProvinceName     = optional\nlocalityName            = optional\norganizationName        = optional\norganizationalUnitName  = optional\ncommonName              = supplied\nemailAddress            = optional\n```\n\n`[req]` bölümündeki seçenekler, sertifika veya sertifika imzalama isteği oluştururken uygulanır.\n\n```\n[ req ]\n# Options for the `req` tool (`man req`).\ndefault_bits        = 2048\ndistinguished_name  = req_distinguished_name\nstring_mask         = utf8only\n\n# SHA-1 is deprecated, so use SHA-2 instead.\ndefault_md          = sha256\n\n# Extension to add when the -x509 option is used.\nx509_extensions     = v3_ca\n```\n\n`[req_distinguished_name]` bölümü, bir sertifika imzalama talebinde gerekli olan bilgileri içerir. İsterseniz bazı varsayılanlar belirleyebilirsiniz.\n\n```\n[ req_distinguished_name ]\n# See \u003chttps://en.wikipedia.org/wiki/Certificate_signing_request\u003e.\ncountryName                     = Country Name (2 letter code)\nstateOrProvinceName             = State or Province Name\nlocalityName                    = Locality Name\n0.organizationName              = Organization Name\norganizationalUnitName          = Organizational Unit Name\ncommonName                      = Common Name\nemailAddress                    = Email Address\n\n# Optionally, specify some defaults.\ncountryName_default             = GB\nstateOrProvinceName_default     = England\nlocalityName_default            =\n0.organizationName_default      = Alice Ltd\n#organizationalUnitName_default =\n#emailAddress_default           =\n```\n\nSonraki birkaç bölüm, sertifikaları imzalarken uygulanabilecek uzantılardır. Örneğin `-extensions v3_ca` komut satırı argümanını kullarak `[v3_ca]` da belirtilen seçenekleri uygulamış oluruz.\n\nKök sertifikayı oluştururken `v3_ca` uzantısı için başvuracağız.\n\n```\n[ v3_ca ]\n# Extensions for a typical CA (`man x509v3_config`).\nsubjectKeyIdentifier = hash\nauthorityKeyIdentifier = keyid:always,issuer\nbasicConstraints = critical, CA:true\nkeyUsage = critical, digitalSignature, cRLSign, keyCertSign\n```\n\nAra sertifika oluşturduğumuzda `v3_ca_intermediate` uzantısından faydalanacağız. `pathlen:0`, ara CA'nın altında daha fazla sertifika yetkilisinin bulunmamasını sağlar.\n\n```\n[ v3_intermediate_ca ]\n# Extensions for a typical intermediate CA (`man x509v3_config`).\nsubjectKeyIdentifier = hash\nauthorityKeyIdentifier = keyid:always,issuer\nbasicConstraints = critical, CA:true, pathlen:0\nkeyUsage = critical, digitalSignature, cRLSign, keyCertSign\n```\n\nUzak kullanıcı kimlik doğrulaması için kullanılan istemci sertifikalarını imzalarken, `usr_cert` uzantısına başvuruda bulunacağız.\n\n```\n[ usr_cert ]\n# Extensions for client certificates (`man x509v3_config`).\nbasicConstraints = CA:FALSE\nnsCertType = client, email\nnsComment = \"OpenSSL Generated Client Certificate\"\nsubjectKeyIdentifier = hash\nauthorityKeyIdentifier = keyid,issuer\nkeyUsage = critical, nonRepudiation, digitalSignature, keyEncipherment\nextendedKeyUsage = clientAuth, emailProtection\n```\n\nWeb sunucuları için kullanılan sunucu sertifikalarını imzalarken `server_cert` uzantısını uygulayacağız.\n\n```\n[ server_cert ]\n# Extensions for server certificates (`man x509v3_config`).\nbasicConstraints = CA:FALSE\nnsCertType = server\nnsComment = \"OpenSSL Generated Server Certificate\"\nsubjectKeyIdentifier = hash\nauthorityKeyIdentifier = keyid,issuer:always\nkeyUsage = critical, digitalSignature, keyEncipherment\nextendedKeyUsage = serverAuth\n```\n\nSertifika iptal listelerini oluştururken `crl_ext` uzantısı otomatik olarak uygulanacaktır.\n\n```\n[ crl_ext ]\n# Extension for CRLs (`man x509v3_config`).\nauthorityKeyIdentifier=keyid:always\n```\n\nOnline Sertifika Durumu Protokolü (OCSP) sertifikasını imzalarken 'ocsp' uzantısını uygulayacağız.\n\n```\n[ ocsp ]\n# Extension for OCSP signing certificates (`man ocsp`).\nbasicConstraints = CA:FALSE\nsubjectKeyIdentifier = hash\nauthorityKeyIdentifier = keyid,issuer\nkeyUsage = critical, digitalSignature\nextendedKeyUsage = critical, OCSPSigning\n```\n\n\u003cdetails\u003e\n\n### Prepare the configuration file\n\nYou must create a configuration file for OpenSSL to use. Copy the root CA configuration file from the [Appendix](#) to `/root/ca/openssl.cnf`.\n\nThe `[ ca ]` section is mandatory. Here we tell OpenSSL to use the options from the `[ CA_default ]` section.\n\n```\n[ ca ]\n# `man ca`\ndefault_ca = CA_default\n```\n\nThe `[ CA_default ]` section contains a range of defaults. Make sure you declare the directory you chose earlier (`/root/ca`).\n\n```\n[ CA_default ]\n# Directory and file locations.\ndir               = /root/ca\ncerts             = $dir/certs\ncrl_dir           = $dir/crl\nnew_certs_dir     = $dir/newcerts\ndatabase          = $dir/index.txt\nserial            = $dir/serial\nRANDFILE          = $dir/private/.rand\n\n# The root key and root certificate.\nprivate_key       = $dir/private/ca.key.pem\ncertificate       = $dir/certs/ca.cert.pem\n\n# For certificate revocation lists.\ncrlnumber         = $dir/crlnumber\ncrl               = $dir/crl/ca.crl.pem\ncrl_extensions    = crl_ext\ndefault_crl_days  = 30\n\n# SHA-1 is deprecated, so use SHA-2 instead.\ndefault_md        = sha256\n\nname_opt          = ca_default\ncert_opt          = ca_default\ndefault_days      = 375\npreserve          = no\npolicy            = policy_strict\n```\n\nWe’ll apply `policy_strict` for all root CA signatures, as the root CA is only being used to create intermediate CAs.\n\n```\n[ policy_strict ]\n# The root CA should only sign intermediate certificates that match.\n# See the POLICY FORMAT section of `man ca`.\ncountryName             = match\nstateOrProvinceName     = match\norganizationName        = match\norganizationalUnitName  = optional\ncommonName              = supplied\nemailAddress            = optional\n```\n\nWe’ll apply `policy_loose` for all intermediate CA signatures, as the intermediate CA is signing server and client certificates that may come from a variety of third-parties.\n\n```\n[ policy_loose ]\n# Allow the intermediate CA to sign a more diverse range of certificates.\n# See the POLICY FORMAT section of the `ca` man page.\ncountryName             = optional\nstateOrProvinceName     = optional\nlocalityName            = optional\norganizationName        = optional\norganizationalUnitName  = optional\ncommonName              = supplied\nemailAddress            = optional\n```\n\nOptions from the `[ req ]` section are applied when creating certificates or certificate signing requests.\n\n```\n[ req ]\n# Options for the `req` tool (`man req`).\ndefault_bits        = 2048\ndistinguished_name  = req_distinguished_name\nstring_mask         = utf8only\n\n# SHA-1 is deprecated, so use SHA-2 instead.\ndefault_md          = sha256\n\n# Extension to add when the -x509 option is used.\nx509_extensions     = v3_ca\n```\n\nThe `[ req_distinguished_name ]` section declares the information normally required in a certificate signing request. You can optionally specify some defaults.\n\n```\n[ req_distinguished_name ]\n# See \u003chttps://en.wikipedia.org/wiki/Certificate_signing_request\u003e.\ncountryName                     = Country Name (2 letter code)\nstateOrProvinceName             = State or Province Name\nlocalityName                    = Locality Name\n0.organizationName              = Organization Name\norganizationalUnitName          = Organizational Unit Name\ncommonName                      = Common Name\nemailAddress                    = Email Address\n\n# Optionally, specify some defaults.\ncountryName_default             = GB\nstateOrProvinceName_default     = England\nlocalityName_default            =\n0.organizationName_default      = Alice Ltd\n#organizationalUnitName_default =\n#emailAddress_default           =\n```\n\nThe next few sections are extensions that can be applied when signing certificates. For example, passing the `-extensions v3_ca` command-line argument will apply the options set in `[ v3_ca ]`.\n\nWe’ll apply the `v3_ca` extension when we create the root certificate.\n\n```\n[ v3_ca ]\n# Extensions for a typical CA (`man x509v3_config`).\nsubjectKeyIdentifier = hash\nauthorityKeyIdentifier = keyid:always,issuer\nbasicConstraints = critical, CA:true\nkeyUsage = critical, digitalSignature, cRLSign, keyCertSign\n```\n\nWe’ll apply the `v3_ca_intermediate` extension when we create the intermediate certificate. `pathlen:0` ensures that there can be no further certificate authorities below the intermediate CA.\n\n```\n[ v3_intermediate_ca ]\n# Extensions for a typical intermediate CA (`man x509v3_config`).\nsubjectKeyIdentifier = hash\nauthorityKeyIdentifier = keyid:always,issuer\nbasicConstraints = critical, CA:true, pathlen:0\nkeyUsage = critical, digitalSignature, cRLSign, keyCertSign\n```\n\nWe’ll apply the `usr_cert` extension when signing client certificates, such as those used for remote user authentication.\n\n```\n[ usr_cert ]\n# Extensions for client certificates (`man x509v3_config`).\nbasicConstraints = CA:FALSE\nnsCertType = client, email\nnsComment = \"OpenSSL Generated Client Certificate\"\nsubjectKeyIdentifier = hash\nauthorityKeyIdentifier = keyid,issuer\nkeyUsage = critical, nonRepudiation, digitalSignature, keyEncipherment\nextendedKeyUsage = clientAuth, emailProtection\n```\n\nWe’ll apply the `server_cert` extension when signing server certificates, such as those used for web servers.\n\n```\n[ server_cert ]\n# Extensions for server certificates (`man x509v3_config`).\nbasicConstraints = CA:FALSE\nnsCertType = server\nnsComment = \"OpenSSL Generated Server Certificate\"\nsubjectKeyIdentifier = hash\nauthorityKeyIdentifier = keyid,issuer:always\nkeyUsage = critical, digitalSignature, keyEncipherment\nextendedKeyUsage = serverAuth\n```\n\nThe `crl_ext` extension is automatically applied when creating certificate revocation lists.\n\n```\n[ crl_ext ]\n# Extension for CRLs (`man x509v3_config`).\nauthorityKeyIdentifier=keyid:always\n```\n\nWe’ll apply the `ocsp` extension when signing the Online Certificate Status Protocol (OCSP) certificate.\n\n```\n[ ocsp ]\n# Extension for OCSP signing certificates (`man ocsp`).\nbasicConstraints = CA:FALSE\nsubjectKeyIdentifier = hash\nauthorityKeyIdentifier = keyid,issuer\nkeyUsage = critical, digitalSignature\nextendedKeyUsage = critical, OCSPSigning\n```\n\u003c/details\u003e\n\n### Kök Anahtarın Oluşturulması\n\nKök anahtarı oluşturun (`ca.key.pem`) ve kesinlikle güvende olmasını sağlayın. Kök anahtarına sahip herkes güvenilir sertifikalar verebilir. Kök anahtarını AES 256-bit ile güçlü bir parola kullanarak şifreleyin.\n\n\u003e Not: Tüm kök ve ara sertifika yetkilileri için 4096 bit şifreleme kullanın. 4096 bit şifreleme ile de kısa bir sürede sunucu ve istemci sertifikalarını imzalayabilirsiniz.\n\n```\ncd /root/ca\nopenssl genrsa -aes256 -out private/ca.key.pem 4096\n\nEnter pass phrase for ca.key.pem: secretpassword\nVerifying - Enter pass phrase for ca.key.pem: secretpassword\n\nchmod 400 private/ca.key.pem\n```\n\n\u003cdetails\u003e\n\n### Create the root key\n\nCreate the root key (`ca.key.pem`) and keep it absolutely secure. Anyone in possession of the root key can issue trusted certificates. Encrypt the root key with AES 256-bit encryption and a strong password.\n\n\u003e Note : Use 4096 bits for all root and intermediate certificate authority keys. You’ll still be able to sign server and client certificates of a shorter length.\n\n```\ncd /root/ca\nopenssl genrsa -aes256 -out private/ca.key.pem 4096\n\nEnter pass phrase for ca.key.pem: secretpassword\nVerifying - Enter pass phrase for ca.key.pem: secretpassword\n\nchmod 400 private/ca.key.pem\n```\n\n\u003c/details\u003e\n\n### Kök Sertifikayı Oluşturun\n\nBir kök sertifika (`ca.cert.pem`) oluşturmak için kök anahtarını (`ca.key.pem`) kullanın. Kök sertifikaya yirmi yıl gibi uzun bir son kullanma tarihi verin. Kök sertifikanın süresi dolduğunda, CA tarafından imzalanmış tüm sertifikalar geçersiz olur.\n\n\u003e Not: `req` aracını her kullandığınızda,` -config` seçeneği ile kullanılacak bir konfigürasyon dosyası belirtmelisiniz, aksi halde OpenSSL varsayılan olarak tanımlı `/etc/pki/tls/openssl.cnf` dosyasını kullanacaktır.\n\n```\ncd /root/ca\nopenssl req -config openssl.cnf -key private/ca.key.pem -new -x509 -days 7300 -sha256 -extensions v3_ca -out certs/ca.cert.pem\n\nEnter pass phrase for ca.key.pem: secretpassword\nYou are about to be asked to enter information that will be incorporated\ninto your certificate request.\n-----\nCountry Name (2 letter code) [XX]:GB\nState or Province Name []:England\nLocality Name []:\nOrganization Name []:Alice Ltd\nOrganizational Unit Name []:Alice Ltd Certificate Authority\nCommon Name []:Alice Ltd Root CA\nEmail Address []:\n\nchmod 444 certs/ca.cert.pem\n```\n\n\u003cdetails\u003e\n\n### Create the root certificate\n\nUse the root key (`ca.key.pem`) to create a root certificate (`ca.cert.pem`). Give the root certificate a long expiry date, such as twenty years. Once the root certificate expires, all certificates signed by the CA become invalid.\n\n\u003e Note: Whenever you use the `req` tool, you must specify a configuration file to use with the `-config` option, otherwise OpenSSL will default to `/etc/pki/tls/openssl.cnf`.\n\n```\ncd /root/ca\nopenssl req -config openssl.cnf -key private/ca.key.pem -new -x509 -days 7300 -sha256 -extensions v3_ca -out certs/ca.cert.pem\n\nEnter pass phrase for ca.key.pem: secretpassword\nYou are about to be asked to enter information that will be incorporated\ninto your certificate request.\n-----\nCountry Name (2 letter code) [XX]:GB\nState or Province Name []:England\nLocality Name []:\nOrganization Name []:Alice Ltd\nOrganizational Unit Name []:Alice Ltd Certificate Authority\nCommon Name []:Alice Ltd Root CA\nEmail Address []:\n\nchmod 444 certs/ca.cert.pem\n```\n\n\u003c/details\u003e\n\n### Kök Sertifikayı Doğrulayın\n\n```\nopenssl x509 -noout -text -in certs/ca.cert.pem\n```\n\nÇıktı şu şekilde olacaktır:\n\n* Kullanılan İmza Algoritması (`Signature Algorithm`)\n* Sertifika geçerlilik tarihleri (`Validity`)\n* Genel Anahtar bit uzunluğu (`Public-Key`)\n* Sertifikayı imzalayan Sağlayıcı (`Issuer`)\n* Sertifika kendisine atıfta bulunan Konu (`Subject`)\n\nSertifika kendinden imzalı olduğu için \"Sağlayıcı\" ve \"Konu\" aynıdır. Tüm kök sertifikaların kendinden imzalı olduğunu unutmayın.\n\n```\nSignature Algorithm: sha256WithRSAEncryption\n    Issuer: C=GB, ST=England,\n            O=Alice Ltd, OU=Alice Ltd Certificate Authority,\n            CN=Alice Ltd Root CA\n    Validity\n        Not Before: Apr 11 12:22:58 2015 GMT\n        Not After : Apr  6 12:22:58 2035 GMT\n    Subject: C=GB, ST=England,\n             O=Alice Ltd, OU=Alice Ltd Certificate Authority,\n             CN=Alice Ltd Root CA\n    Subject Public Key Info:\n        Public Key Algorithm: rsaEncryption\n            Public-Key: (4096 bit)\n```\n\nÇıktı ayrıca X509v3 uzantılarını gösterir. `v3_ca` uzantısını uyguladık, bu nedenle `[v3_ca]`'dan gelen seçenekler çıktıyı etkileyecektir.\n\n```\nX509v3 extensions:\n    X509v3 Subject Key Identifier:\n        38:58:29:2F:6B:57:79:4F:39:FD:32:35:60:74:92:60:6E:E8:2A:31\n    X509v3 Authority Key Identifier:\n        keyid:38:58:29:2F:6B:57:79:4F:39:FD:32:35:60:74:92:60:6E:E8:2A:31\n\n    X509v3 Basic Constraints: critical\n        CA:TRUE\n    X509v3 Key Usage: critical\n        Digital Signature, Certificate Sign, CRL Sign\n```\n\n\u003cdetails\u003e\n\n### Verify the root certificate\n\n```\nopenssl x509 -noout -text -in certs/ca.cert.pem\n```\n\nThe output shows:\n\n* the Signature Algorithm used\n* the dates of certificate Validity\n* the Public-Key bit length\n* the Issuer, which is the entity that signed the certificate\n* the Subject, which refers to the certificate itself\n\nThe `Issuer` and `Subject` are identical as the certificate is self-signed. Note that all root certificates are self-signed.\n\n```\nSignature Algorithm: sha256WithRSAEncryption\n    Issuer: C=GB, ST=England,\n            O=Alice Ltd, OU=Alice Ltd Certificate Authority,\n            CN=Alice Ltd Root CA\n    Validity\n        Not Before: Apr 11 12:22:58 2015 GMT\n        Not After : Apr  6 12:22:58 2035 GMT\n    Subject: C=GB, ST=England,\n             O=Alice Ltd, OU=Alice Ltd Certificate Authority,\n             CN=Alice Ltd Root CA\n    Subject Public Key Info:\n        Public Key Algorithm: rsaEncryption\n            Public-Key: (4096 bit)\n```\n\nThe output also shows the X509v3 extensions. We applied the `v3_ca` extension, so the options from `[ v3_ca ]` should be reflected in the output.\n\n```\nX509v3 extensions:\n    X509v3 Subject Key Identifier:\n        38:58:29:2F:6B:57:79:4F:39:FD:32:35:60:74:92:60:6E:E8:2A:31\n    X509v3 Authority Key Identifier:\n        keyid:38:58:29:2F:6B:57:79:4F:39:FD:32:35:60:74:92:60:6E:E8:2A:31\n\n    X509v3 Basic Constraints: critical\n        CA:TRUE\n    X509v3 Key Usage: critical\n        Digital Signature, Certificate Sign, CRL Sign\n```\n\u003c/details\u003e\n\n## Ara (intermediate) Anahtar Çifti Oluşturun\n\nBir ara sertifika yetkilisi (CA), kök CA adına sertifikalar imzalayabilen bir alt mercidir. Kök CA, ara sertifikayı imzalar ve bir güven zinciri oluşturur.\n\nBir ara CA kullanmanın amacı öncelikle güvenliği sağlamaktır. Kök anahtarı çevrimdışı tutulur ve olabildiğince az kullanılır. Eğer Ara anahtar ele geçirilirse, kök CA, ara sertifikayı iptal edebilir ve yeni bir ara şifreleme çifti oluşturabilir.\n\n\u003cdetails\u003e\n\n## Create the intermediate pair\n\nAn intermediate certificate authority (CA) is an entity that can sign certificates on behalf of the root CA. The root CA signs the intermediate certificate, forming a chain of trust.\n\nThe purpose of using an intermediate CA is primarily for security. The root key can be kept offline and used as infrequently as possible. If the intermediate key is compromised, the root CA can revoke the intermediate certificate and create a new intermediate cryptographic pair.\n\n\u003c/details\u003e\n\n### Dizini Hazırlayın\n\nKök CA dosyaları `/root/ca` klasörinde saklanır. Ara CA dosyalarını saklamak için farklı bir dizin seçin (`/root/ca/intermediate`).\n\n```\nmkdir /root/ca/intermediate\n```\n\nKök CA dosyaları için kullanılan aynı dizin yapısını oluşturun. Sertifika imzalama taleplerini tutmak için bir `csr` dizini yaratmak da uygundur.\n\n```\ncd /root/ca/intermediate\nmkdir certs crl csr newcerts private\nchmod 700 private\ntouch index.txt\necho 1000 \u003e serial\n```\n\nAra CA dizin ağacına bir `crlnumber` dosyası ekleyin. `crlnumber`, sertifika iptal listelerini takip etmek için kullanılır.\n\n```\necho 1000 \u003e /root/ca/intermediate/crlnumber\n```\n\nAra CA yapılandırma dosyasını [Ek](#)'ten `/root/ca/intermediate/openssl.cnf` dosyasına kopyalayın. \n\nKök CA yapılandırma dosyasıyla karşılaştırıldığında beş seçeneğin farklı olduğunu görürüz:\n\n```\n[ CA_default ]\ndir             = /root/ca/intermediate\nprivate_key     = $dir/private/intermediate.key.pem\ncertificate     = $dir/certs/intermediate.cert.pem\ncrl             = $dir/crl/intermediate.crl.pem\npolicy          = policy_loose\n```\n\n\u003cdetails\u003e\n\n### Prepare the directory\n\nThe root CA files are kept in `/root/ca`. Choose a different directory (`/root/ca/intermediate`) to store the intermediate CA files.\n\n```\nmkdir /root/ca/intermediate\n```\n\nCreate the same directory structure used for the root CA files. It’s convenient to also create a `csr` directory to hold certificate signing requests.\n\n```\ncd /root/ca/intermediate\nmkdir certs crl csr newcerts private\nchmod 700 private\ntouch index.txt\necho 1000 \u003e serial\n```\n\nAdd a `crlnumber` file to the intermediate CA directory tree. `crlnumber` is used to keep track of certificate revocation lists.\n\n```\necho 1000 \u003e /root/ca/intermediate/crlnumber\n```\n\nCopy the intermediate CA configuration file from the Appendix to `/root/ca/intermediate/openssl.cnf`. Five options have been changed compared to the root CA configuration file:\n\n```\n[ CA_default ]\ndir             = /root/ca/intermediate\nprivate_key     = $dir/private/intermediate.key.pem\ncertificate     = $dir/certs/intermediate.cert.pem\ncrl             = $dir/crl/intermediate.crl.pem\npolicy          = policy_loose\n```\n\u003c/details\u003e\n\n### Ara Anahtarı Oluşturun\n\nAra anahtarı oluşturun (`intermediate.key.pem`). Ara anahtarı AES 256-bit ile güçlü bir parola kullanarak şifreleyin.\n\n```\ncd /root/ca\nopenssl genrsa -aes256 -out intermediate/private/intermediate.key.pem 4096\n\nEnter pass phrase for intermediate.key.pem: secretpassword\nVerifying - Enter pass phrase for intermediate.key.pem: secretpassword\n\nchmod 400 intermediate/private/intermediate.key.pem\n```\n\n\u003cdetails\u003e\n\n### Create the intermediate key\n\nCreate the intermediate key (`intermediate.key.pem`). Encrypt the intermediate key with AES 256-bit encryption and a strong password.\n\n```\ncd /root/ca\nopenssl genrsa -aes256 -out intermediate/private/intermediate.key.pem 4096\n\nEnter pass phrase for intermediate.key.pem: secretpassword\nVerifying - Enter pass phrase for intermediate.key.pem: secretpassword\n\nchmod 400 intermediate/private/intermediate.key.pem\n```\n\u003c/details\u003e\n\n### Ara Sertifika Oluşturun\n\nBir sertifika imzalama isteği (CSR) oluşturmak için ara anahtarı kullanın. Yapılandırma ayarları genellikle kök CA ile eşleşmelidir. Ancak Ortak Ad (**Common Name**) farklı olmalıdır.\n\n\u003e Uyarı: Ara CA yapılandırma dosyasını belirttiğinizden emin olun (`intermediate/openssl.cnf`).\n\n```\ncd /root/ca\n# openssl req -config intermediate/openssl.cnf -new -sha256 -key intermediate/private/intermediate.key.pem \\\n      -out intermediate/csr/intermediate.csr.pem\n\nEnter pass phrase for intermediate.key.pem: secretpassword\nYou are about to be asked to enter information that will be incorporated\ninto your certificate request.\n-----\nCountry Name (2 letter code) [XX]:GB\nState or Province Name []:England\nLocality Name []:\nOrganization Name []:Alice Ltd\nOrganizational Unit Name []:Alice Ltd Certificate Authority\nCommon Name []:Alice Ltd Intermediate CA\nEmail Address []:\n```\n\nBir ara sertifika oluşturmak için, Kök CA ile `v3_intermediate_ca` uzantısını kullarak ara CSR'yi imzalayın. Ara sertifika kök sertifikadan daha kısa bir süre geçerli olmalıdır. On yıl uygun olabilir.\n\n\u003e Uyarı: Bu sefer, kök CA yapılandırma dosyasını belirtin (`/root/ca/openssl.cnf`).\n\n```\ncd /root/ca\nopenssl ca -config openssl.cnf -extensions v3_intermediate_ca -days 3650 -notext -md sha256 \\\n      -in intermediate/csr/intermediate.csr.pem -out intermediate/certs/intermediate.cert.pem\n\nEnter pass phrase for ca.key.pem: secretpassword\nSign the certificate? [y/n]: y\n\nchmod 444 intermediate/certs/intermediate.cert.pem\n```\n\n`index.txt` dosyası, OpenSSL `ca` aracının sertifika veritabanının depoladığı yerdir. Bu dosyayı silmeyin veya düzenlemeyin. Şimdi; `index.txt` dosyası, ara sertifika ile ilgili bir satır içermelidir.\n\n```\nV 250408122707Z 1000 unknown ... /CN=Alice Ltd Intermediate CA\n```\n\n\u003cdetails\u003e\n\n### Create the intermediate certificate\n\nUse the intermediate key to create a certificate signing request (CSR). The details should generally match the root CA. The Common Name, however, must be different.\n\n\u003e Warning: Make sure you specify the intermediate CA configuration file (`intermediate/openssl.cnf`).\n\n```\ncd /root/ca\nopenssl req -config intermediate/openssl.cnf -new -sha256 \\\n      -key intermediate/private/intermediate.key.pem -out intermediate/csr/intermediate.csr.pem\n\nEnter pass phrase for intermediate.key.pem: secretpassword\nYou are about to be asked to enter information that will be incorporated\ninto your certificate request.\n-----\nCountry Name (2 letter code) [XX]:GB\nState or Province Name []:England\nLocality Name []:\nOrganization Name []:Alice Ltd\nOrganizational Unit Name []:Alice Ltd Certificate Authority\nCommon Name []:Alice Ltd Intermediate CA\nEmail Address []:\n```\n\nTo create an intermediate certificate, use the root CA with the `v3_intermediate_ca` extension to sign the intermediate CSR. The intermediate certificate should be valid for a shorter period than the root certificate. Ten years would be reasonable.\n\n\u003e Warning: This time, specify the root CA configuration file (`/root/ca/openssl.cnf`).\n\n```\ncd /root/ca\nopenssl ca -config openssl.cnf -extensions v3_intermediate_ca -days 3650 -notext -md sha256 \\\n      -in intermediate/csr/intermediate.csr.pem -out intermediate/certs/intermediate.cert.pem\n\nEnter pass phrase for ca.key.pem: secretpassword\nSign the certificate? [y/n]: y\n\nchmod 444 intermediate/certs/intermediate.cert.pem\n```\n\nThe `index.txt` file is where the OpenSSL `ca` tool stores the certificate database. Do not delete or edit this file by hand. It should now contain a line that refers to the intermediate certificate.\n\n```\nV 250408122707Z 1000 unknown ... /CN=Alice Ltd Intermediate CA\n```\n\n\u003c/details\u003e\n\n### Ara Sertifikayı Doğrulayın\n\nKök sertifika için yaptığımız gibi ara sertifikanın ayrıntılarının doğru olup olmadığını kontrol edin.\n\n```\nopenssl x509 -noout -text -in intermediate/certs/intermediate.cert.pem\n```\n\nKök sertifika ile ara sertifikayı doğrulayın. \"OK\" çıktısı, güven zincirinin sağlam olduğunu gösterir.\n\n```\nopenssl verify -CAfile certs/ca.cert.pem intermediate/certs/intermediate.cert.pem\n\nintermediate.cert.pem: OK\n```\n\n\u003cdetails\u003e\n\n### Verify the intermediate certificate\n\nAs we did for the root certificate, check that the details of the intermediate certificate are correct.\n\n```\nopenssl x509 -noout -text -in intermediate/certs/intermediate.cert.pem\n```\n\nVerify the intermediate certificate against the root certificate. An `OK` indicates that the chain of trust is intact.\n\n```\nopenssl verify -CAfile certs/ca.cert.pem intermediate/certs/intermediate.cert.pem\n\nintermediate.cert.pem: OK\n```\n\n\u003c/details\u003e\n\n### Sertifika Zinciri Dosyası Oluşturun (ca-chain.cert.pem)\n\nBir uygulama (örneğin bir web tarayıcısı) ara CA tarafından imzalanmış bir sertifikayı doğrulamaya çalıştığında, o da kök sertifika ile ara sertifikayı doğrulayabilmelidir. Güven zincirini tamamlamak için, uygulamaya sunulacak bir CA sertifika zinciri oluşturun.\n\nCA sertifika zincirini oluşturmak için, ara ve kök sertifikaları bir araya getirin. Bu dosyayı daha sonra ara CA tarafından imzalanmış sertifikaları doğrulamak için kullanacağız.\n\n```\ncat intermediate/certs/intermediate.cert.pem certs/ca.cert.pem \u003e intermediate/certs/ca-chain.cert.pem\nchmod 444 intermediate/certs/ca-chain.cert.pem\n```\n\n\u003e Not: İstemciler, kök sertifikayı bilmediği için sertifika zinciri dosyamız kök sertifikayı da içermelidir. Daha iyi bir seçenek, özellikle bir intraneti yönetiyorsanız, kök sertifikanızı bütün istemcilere yüklemektir. Bu durumda, zincir dosyasının yalnızca ara sertifika içermesi yeterlidir.\n\n\u003cdetails\u003e\n\n### Create the certificate chain file\n\nWhen an application (eg, a web browser) tries to verify a certificate signed by the intermediate CA, it must also verify the intermediate certificate against the root certificate. To complete the chain of trust, create a CA certificate chain to present to the application.\n\nTo create the CA certificate chain, concatenate the intermediate and root certificates together. We will use this file later to verify certificates signed by the intermediate CA.\n\n```\ncat intermediate/certs/intermediate.cert.pem certs/ca.cert.pem \u003e intermediate/certs/ca-chain.cert.pem\nchmod 444 intermediate/certs/ca-chain.cert.pem\n```\n\n\u003e Note: Our certificate chain file must include the root certificate because no client application knows about it yet. A better option, particularly if you’re administrating an intranet, is to install your root certificate on every client that needs to connect. In that case, the chain file need only contain your intermediate certificate.\n\n\u003c/details\u003e\n\n## Sunucu ve İstemci Sertifikalarını İmzalayın\n\nŞimdi Ara CA'nızı kullanarak sertifika imzalayacağız. Bu imzalı sertifikaları, bir web sunucusuna olan bağlantıları güvenli kılmak veya bir servise bağlanan istemcileri doğrulamak gibi çeşitli durumlarda kullanabilirsiniz.\n\n\u003e Not: Aşağıdaki adımlar, sertifika yetkilisi olarak uyguladığımız bir bakış açısının sonucudur. Bu bakış açısının yerine, istemci kendi özel anahtarını ve sertifika imzalama isteğini (CSR) kendi anahtarını size göstermeden oluşturabilir. Size kendi CSR'ını verirler ve sizde imzalı bir sertifikayı geri verirsiniz. Böyle bir durumda senaryoda `genrsa` ve` req` komutlarını atlayabilirsiniz.\n\n\u003cdetails\u003e\n\n## Sign server and client certificates\n\nWe will be signing certificates using our intermediate CA. You can use these signed certificates in a variety of situations, such as to secure connections to a web server or to authenticate clients connecting to a service.\n\n\u003e Note: The steps below are from your perspective as the certificate authority. A third-party, however, can instead create their own private key and certificate signing request (CSR) without revealing their private key to you. They give you their CSR, and you give back a signed certificate. In that scenario, skip the `genrsa` and `req` commands.\n\n\u003c/details\u003e\n\n### Bir Anahtar Oluşturun\n\nKök ve ara çiftlerimiz 4096 bit'tir. Sunucu ve istemci sertifikaları normalde bir yıl sonra sona erecek, bu sebeple sunucu ve istemci için 2048 bit'i güvenle kullanabilirsiniz.\n\n\u003e Not: 4096 bit, 2048 bit'ten biraz daha güvenli olmasına rağmen, TLS doğrulamasını yavaşlatır ve doğrulama sırasında işlemci yükünü önemli ölçüde artırır. Bu nedenle çoğu web sitesi 2048 bit'lik çift kullanır.\n\nBir web sunucusu (ör. Apache) ile kullanılacak şifreleme çifti oluşturuyorsanız, web sunucusunu her yeniden başlattığınızda bu şifreyi girmeniz gerekecektir. Parolasız bir anahtar oluşturmak için `-aes256` seçeneğini çıkartmak isteyebilirsiniz.\n\n```\ncd /root/ca\nopenssl genrsa -aes256 -out intermediate/private/www.example.com.key.pem 2048\nchmod 400 intermediate/private/www.example.com.key.pem\n```\n\n\u003cdetails\u003e\n\n### Create a key\n\nOur root and intermediate pairs are 4096 bits. Server and client certificates normally expire after one year, so we can safely use 2048 bits instead.\n\n\u003e Note: Although 4096 bits is slightly more secure than 2048 bits, it slows down TLS handshakes and significantly increases processor load during handshakes. For this reason, most websites use 2048-bit pairs.\n\nIf you’re creating a cryptographic pair for use with a web server (eg, Apache), you’ll need to enter this password every time you restart the web server. You may want to omit the `-aes256` option to create a key without a password.\n\n```\ncd /root/ca\nopenssl genrsa -aes256 -out intermediate/private/www.example.com.key.pem 2048\nchmod 400 intermediate/private/www.example.com.key.pem\n```\n\n\u003c/details\u003e\n\n### Bir Sertifika Oluşturun\n\nBir sertifika imzalama isteği (CSR) oluşturmak için özel anahtar kullanın. CSR ayrıntılarının ara CA ile eşleşmesi gerekmez. Sunucu sertifikaları için, Ortak Ad (**Common Name**), bir tam nitelikli alan adı (ör. 'www.example.com') olmalıdır, oysa istemci sertifikaları için herhangi bir benzersiz tanımlayıcı (ör. Bir e-posta adresi) olabilir. Ortak Adın, kök veya ara sertifikanızla aynı __olamayacağına__ dikkat edin.\n\n```\ncd /root/ca\nopenssl req -config intermediate/openssl.cnf \\\n      -key intermediate/private/www.example.com.key.pem -new -sha256 -out intermediate/csr/www.example.com.csr.pem\n\nEnter pass phrase for www.example.com.key.pem: secretpassword\nYou are about to be asked to enter information that will be incorporated\ninto your certificate request.\n-----\nCountry Name (2 letter code) [XX]:US\nState or Province Name []:California\nLocality Name []:Mountain View\nOrganization Name []:Alice Ltd\nOrganizational Unit Name []:Alice Ltd Web Services\nCommon Name []:www.example.com\nEmail Address []:\n```\n\nCSR'yi imzalamak için ara CA'yı kullanın ve sertifika oluşturun. Sertifika bir sunucuda kullanılacaksa, `server_cert` uzantısını kullanın. Sertifika kullanıcı kimlik doğrulaması için kullanılacak ise, `usr_cert` uzantısını kullanın. Bu sertifikalara genellikle bir yıl geçerliliği verilir ancak kolaylık sağlamak için sertfika yetkilisi CA ekstra bir kaç gün daha verir.\n\n```\ncd /root/ca\nopenssl ca -config intermediate/openssl.cnf -extensions server_cert -days 375 -notext -md sha256 \\\n      -in intermediate/csr/www.example.com.csr.pem -out intermediate/certs/www.example.com.cert.pem\nchmod 444 intermediate/certs/www.example.com.cert.pem\n```\n\n`intermediate/index.txt` dosyası bu yeni sertifikaya atıf yapan bir satır içermelidir.\n\n```\nV 160420124233Z 1000 unknown ... /CN=www.example.com\n```\n\n\u003cdetails\u003e\n\n### Create a certificate\n\nUse the private key to create a certificate signing request (CSR). The CSR details don’t need to match the intermediate CA. For server certificates, the Common Name must be a fully qualified domain name (eg, `www.example.com`), whereas for client certificates it can be any unique identifier (eg, an e-mail address). Note that the Common Name cannot be the same as either your root or intermediate certificate.\n\n```\ncd /root/ca\nopenssl req -config intermediate/openssl.cnf -key intermediate/private/www.example.com.key.pem \\\n      -new -sha256 -out intermediate/csr/www.example.com.csr.pem\n\nEnter pass phrase for www.example.com.key.pem: secretpassword\nYou are about to be asked to enter information that will be incorporated\ninto your certificate request.\n-----\nCountry Name (2 letter code) [XX]:US\nState or Province Name []:California\nLocality Name []:Mountain View\nOrganization Name []:Alice Ltd\nOrganizational Unit Name []:Alice Ltd Web Services\nCommon Name []:www.example.com\nEmail Address []:\n```\n\nTo create a certificate, use the intermediate CA to sign the CSR. If the certificate is going to be used on a server, use the `server_cert` extension. If the certificate is going to be used for user authentication, use the `usr_cert` extension. Certificates are usually given a validity of one year, though a CA will typically give a few days extra for convenience.\n\n```\ncd /root/ca\nopenssl ca -config intermediate/openssl.cnf -extensions server_cert -days 375 -notext -md sha256 \\\n      -in intermediate/csr/www.example.com.csr.pem -out intermediate/certs/www.example.com.cert.pem\nchmod 444 intermediate/certs/www.example.com.cert.pem\n```\n\nThe `intermediate/index.txt` file should contain a line referring to this new certificate.\n\n```\nV 160420124233Z 1000 unknown ... /CN=www.example.com\n```\n\n\u003c/details\u003e\n\n### Sertifikayı Doğrulayın\n\n```\nopenssl x509 -noout -text -in intermediate/certs/www.example.com.cert.pem\n```\n\nSağlayıcı (Issuer) ara CA'dır. Konu sertifikanın kendisiyle ilgilidir.\n\n```\nSignature Algorithm: sha256WithRSAEncryption\n    Issuer: C=GB, ST=England,\n            O=Alice Ltd, OU=Alice Ltd Certificate Authority,\n            CN=Alice Ltd Intermediate CA\n    Validity\n        Not Before: Apr 11 12:42:33 2015 GMT\n        Not After : Apr 20 12:42:33 2016 GMT\n    Subject: C=US, ST=California, L=Mountain View,\n             O=Alice Ltd, OU=Alice Ltd Web Services,\n             CN=www.example.com\n    Subject Public Key Info:\n        Public Key Algorithm: rsaEncryption\n            Public-Key: (2048 bit)\n```\n\nÇıktı X509v3 uzantılarını da gösterecektir. Sertifika oluşturulurken, `server_cert` veya `usr_cert` uzantısını kullandınız. İlgili yapılandırma bölümündeki seçenekler çıktı ekranına yansıtılacaktır.\n\n```\nX509v3 extensions:\n    X509v3 Basic Constraints:\n        CA:FALSE\n    Netscape Cert Type:\n        SSL Server\n    Netscape Comment:\n        OpenSSL Generated Server Certificate\n    X509v3 Subject Key Identifier:\n        B1:B8:88:48:64:B7:45:52:21:CC:35:37:9E:24:50:EE:AD:58:02:B5\n    X509v3 Authority Key Identifier:\n        keyid:69:E8:EC:54:7F:25:23:60:E5:B6:E7:72:61:F1:D4:B9:21:D4:45:E9\n        DirName:/C=GB/ST=England/O=Alice Ltd/OU=Alice Ltd Certificate Authority/CN=Alice Ltd Root CA\n        serial:10:00\n\n    X509v3 Key Usage: critical\n        Digital Signature, Key Encipherment\n    X509v3 Extended Key Usage:\n        TLS Web Server Authentication\n```\n\nYeni sertifikanın geçerli bir güven zincirine sahip olduğunu doğrulamak için daha önce oluşturduğumuz CA sertifika zinciri dosyasını kullanın (`ca-chain.cert.pem`).\n\n```\nopenssl verify -CAfile intermediate/certs/ca-chain.cert.pem intermediate/certs/www.example.com.cert.pem\n\nwww.example.com.cert.pem: OK\n```\n\n\u003cdetails\u003e\n\n### Verify the certificate\n\n```\nopenssl x509 -noout -text -in intermediate/certs/www.example.com.cert.pem\n```\n\nThe Issuer is the intermediate CA. The Subject refers to the certificate itself.\n\n```\nSignature Algorithm: sha256WithRSAEncryption\n    Issuer: C=GB, ST=England,\n            O=Alice Ltd, OU=Alice Ltd Certificate Authority,\n            CN=Alice Ltd Intermediate CA\n    Validity\n        Not Before: Apr 11 12:42:33 2015 GMT\n        Not After : Apr 20 12:42:33 2016 GMT\n    Subject: C=US, ST=California, L=Mountain View,\n             O=Alice Ltd, OU=Alice Ltd Web Services,\n             CN=www.example.com\n    Subject Public Key Info:\n        Public Key Algorithm: rsaEncryption\n            Public-Key: (2048 bit)\n```\n\nThe output will also show the X509v3 extensions. When creating the certificate, you used either the `server_cert` or `usr_cert` extension. The options from the corresponding configuration section will be reflected in the output.\n\n```\nX509v3 extensions:\n    X509v3 Basic Constraints:\n        CA:FALSE\n    Netscape Cert Type:\n        SSL Server\n    Netscape Comment:\n        OpenSSL Generated Server Certificate\n    X509v3 Subject Key Identifier:\n        B1:B8:88:48:64:B7:45:52:21:CC:35:37:9E:24:50:EE:AD:58:02:B5\n    X509v3 Authority Key Identifier:\n        keyid:69:E8:EC:54:7F:25:23:60:E5:B6:E7:72:61:F1:D4:B9:21:D4:45:E9\n        DirName:/C=GB/ST=England/O=Alice Ltd/OU=Alice Ltd Certificate Authority/CN=Alice Ltd Root CA\n        serial:10:00\n\n    X509v3 Key Usage: critical\n        Digital Signature, Key Encipherment\n    X509v3 Extended Key Usage:\n        TLS Web Server Authentication\n```\n\nUse the CA certificate chain file we created earlier (`ca-chain.cert.pem`) to verify that the new certificate has a valid chain of trust.\n\n```\nopenssl verify -CAfile intermediate/certs/ca-chain.cert.pem intermediate/certs/www.example.com.cert.pem\n\nwww.example.com.cert.pem: OK\n```\n\n\u003c/details\u003e\n\n### Sertifikayı Yayınlayın\n\nArtık yeni sertifikanızı bir sunucuya veya istemciye dağıtabilirsiniz. Bir sunucu uygulamasına (örneğin, Apache) dağıtırken aşağıdaki dosyaları hazır bulundurmanız gerekir:\n\n* `ca-chain.cert.pem`\n* `www.example.com.key.pem`\n* `www.example.com.cert.pem`\n\nÜçüncü taraftan bir CSR imzalıyorsanız, özel anahtarlarına erişemezsiniz, bu nedenle yalnızca zincir dosyasına (`ca-chain.cert.pem`) ve sertifikaya (`www.example.com.cert.pem`) sahip olacaksınız.\n\n\u003cdetails\u003e\n\n### Deploy the certificate\n\nYou can now either deploy your new certificate to a server, or distribute the certificate to a client. When deploying to a server application (eg, Apache), you need to make the following files available:\n\n* `ca-chain.cert.pem`\n* `www.example.com.key.pem`\n* `www.example.com.cert.pem`\n\nIf you’re signing a CSR from a third-party, you don’t have access to their private key so you only need to give them back the chain file (`ca-chain.cert.pem`) and the certificate (`www.example.com.cert.pem`).\n\n\u003c/details\u003e\n\n## Sertifika İptal Listeleri\n\nBir sertifika iptal listesi (CRL), iptal edilen sertifikaların bir listesini sağlar. Web tarayıcısı gibi bir istemci uygulaması, bir sunucunun doğruluğunu kontrol etmek için bir CRL kullanabilir. Apache veya OpenVPN gibi bir sunucu uygulaması, artık güvenilmeyen istemcilere erişimi reddetmek için bir CRL kullanabilir.\n\nCRL'yi herkes tarafından erişilebilir bir adreste yayınlayın (ör. `http://example.com/intermediate.crl.pem`). Üçüncü taraflar, güvenilen herhangi bir sertifikanın iptal edilip edilmediğini kontrol etmek için CRL'yi bu adresten alabilirler.\n\n\u003e Not: Bazı uygulama sağlayıcıları CRL'ler yerine Çevrimiçi Sertifika Durum Protokolü'nü (OCSP) kullanmaktadır.\n\n\u003cdetails\u003e\n\n## Certificate revocation lists\n\nA certificate revocation list (CRL) provides a list of certificates that have been revoked. A client application, such as a web browser, can use a CRL to check a server’s authenticity. A server application, such as Apache or OpenVPN, can use a CRL to deny access to clients that are no longer trusted.\n\nPublish the CRL at a publicly accessible location (eg, `http://example.com/intermediate.crl.pem`). Third-parties can fetch the CRL from this location to check whether any certificates they rely on have been revoked.\n\n\u003e Note: Some applications vendors have deprecated CRLs and are instead using the Online Certificate Status Protocol (OCSP).\n\n\u003c/details\u003e\n\n### Yapılandırma Dosyasını Hazırlayın\n\nBir sertifika yetkilisi bir sertifikayı imzaladığında, normalde CRL konumunu sertifikaya kodlar. Uygun bölümlere `crlDistributionPoints` ekleyin. Bizim durumumuzda, `[server_cert]` bölümüne ekleyin.\n\n```\n[ server_cert ]\n# ... snipped ...\ncrlDistributionPoints = URI:http://example.com/intermediate.crl.pem\n```\n\n\u003cdetails\u003e\n\n### Prepare the configuration file\n\nWhen a certificate authority signs a certificate, it will normally encode the CRL location into the certificate. Add `crlDistributionPoints` to the appropriate sections. In our case, add it to the `[ server_cert ]` section.\n\n```\n[ server_cert ]\n# ... snipped ...\ncrlDistributionPoints = URI:http://example.com/intermediate.crl.pem\n```\n\u003c/details\u003e\n\n### CRL'yi Oluşturun\n\n```\ncd /root/ca\nopenssl ca -config intermediate/openssl.cnf -gencrl -out intermediate/crl/intermediate.crl.pem\n```\n\n\u003e Not: `ca` man sayfasının `CRL OPTIONS` bölümü, CRL'lerin nasıl oluşturulacağı hakkında daha fazla bilgi içerir.\n\nCRL içeriğini `crl` aracı ile kontrol edebilirsiniz.\n\n```\nopenssl crl -in intermediate/crl/intermediate.crl.pem -noout -text\n```\n\nHiçbir sertifika iptal edilmedi, bu nedenle çıktıda `No Revoked Certificates` ifadesi mevcut.\n\nCRL'yi düzenli aralıklarla yeniden oluşturmalısınız. Varsayılan olarak, CRL 30 gün sonra sona erer. Bu, `[CA_default]` bölümündeki `default_crl_days` seçeneği ile kontrol edilir.\n\n\u003cdetails\u003e\n\n### Create the CRL\n\n```\ncd /root/ca\nopenssl ca -config intermediate/openssl.cnf -gencrl -out intermediate/crl/intermediate.crl.pem\n```\n\n\u003e Note: The `CRL OPTIONS` section of the `ca` man page contains more information on how to create CRLs.\n\nYou can check the contents of the CRL with the `crl` tool.\n\n```\nopenssl crl -in intermediate/crl/intermediate.crl.pem -noout -text\n```\n\nNo certificates have been revoked yet, so the output will state `No Revoked Certificates`.\n\nYou should re-create the CRL at regular intervals. By default, the CRL expires after 30 days. This is controlled by the `default_crl_days` option in the `[ CA_default ]` section.\n\n\u003c/details\u003e\n\n### Bir Sertifikayı İptal Edin\n\nBir örnek üzerinden yürüyelim. Alice'in özel, sevimli kedi resimleri içeren koleksiyonu var. Bu koleksiyon, Apache web sunucusu üzerinde yayınlanıyor ve Alice, arkadaşı Bob'a bu koleksiyona bakabilmesi için erişim izni vermek istiyor.\n\nBu durumda Bob özel bir anahtar ve sertifika imzalama isteği (CSR) oluşturur.\n\n```\ncd /home/bob\nopenssl genrsa -out bob@example.com.key.pem 2048\nopenssl req -new -key bob@example.com.key.pem -out bob@example.com.csr.pem\n\nYou are about to be asked to enter information that will be incorporated\ninto your certificate request.\n-----\nCountry Name [XX]:US\nState or Province Name []:California\nLocality Name []:San Francisco\nOrganization Name []:Bob Ltd\nOrganizational Unit Name []:\nCommon Name []:bob@example.com\nEmail Address []:\n```\n\nBob CSR'sini Alice'e gönderir ve Alice imzalar.\n\n```\ncd /root/ca\nopenssl ca -config intermediate/openssl.cnf -extensions usr_cert -notext -md sha256 \\\n      -in intermediate/csr/bob@example.com.csr.pem -out intermediate/certs/bob@example.com.cert.pem\n\nSign the certificate? [y/n]: y\n1 out of 1 certificate requests certified, commit? [y/n]: y\n```\n\nAlice sertifikanın geçerliliğini doğrular:\n\n```\nopenssl verify -CAfile intermediate/certs/ca-chain.cert.pem intermediate/certs/bob@example.com.cert.pem\n\nbob@example.com.cert.pem: OK\n```\n\n`index.txt` dosyası yeni bir girdi içermelidir.\n\n```\nV 160420124740Z 1001 unknown ... /CN=bob@example.com\n```\n\nAlice imzalı sertifikayı Bob'a gönderir. Bob sertifika web tarayıcısına yükler ve artık Alice'in yavru kedi resimlerine erişebilir. Harika!\n\nMaalesef bir süre sonra, Bob'un yanlış davranıldığı anlaşılıyor. Bob, Alice'in yavru kedi resimlerini Hacker News'e gönderdi ve kendisine ait olduklarını iddia etti. Alice durumu öğrendikten sonra derhal Bob'un erişimini iptal etmesi gerekir.\n\n```\ncd /root/ca\nopenssl ca -config intermediate/openssl.cnf -revoke intermediate/certs/bob@example.com.cert.pem\n\nEnter pass phrase for intermediate.key.pem: secretpassword\nRevoking Certificate 1001.\nData Base Updated\n```\n\n`index.text` içindeki Bob'un sertifikasına karşılık gelen satır artık `R` karakteriyle başlar. Bu, sertifikanın iptal edildiği anlamına gelir.\n\n```\nR 160420124740Z 150411125310Z 1001 unknown ... /CN=bob@example.com\n```\n\nBob'un sertifikasını iptal ettikten sonra, Alice CRL'yi yeniden oluşturmalıdır.\n\n\u003cdetails\u003e\n\n### Revoke a certificate\n\nLet’s walk through an example. Alice is running the Apache web server and has a private folder of heart-meltingly cute kitten pictures. Alice wants to grant her friend, Bob, access to this collection.\n\nBob creates a private key and certificate signing request (CSR).\n\n```\ncd /home/bob\nopenssl genrsa -out bob@example.com.key.pem 2048\nopenssl req -new -key bob@example.com.key.pem \\\n      -out bob@example.com.csr.pem\n\nYou are about to be asked to enter information that will be incorporated\ninto your certificate request.\n-----\nCountry Name [XX]:US\nState or Province Name []:California\nLocality Name []:San Francisco\nOrganization Name []:Bob Ltd\nOrganizational Unit Name []:\nCommon Name []:bob@example.com\nEmail Address []:\n```\n\nBob sends his CSR to Alice, who then signs it.\n\n```\ncd /root/ca\nopenssl ca -config intermediate/openssl.cnf -extensions usr_cert -notext -md sha256 \\\n      -in intermediate/csr/bob@example.com.csr.pem -out intermediate/certs/bob@example.com.cert.pem\n\nSign the certificate? [y/n]: y\n1 out of 1 certificate requests certified, commit? [y/n]: y\n```\n\nAlice verifies that the certificate is valid:\n\n```\nopenssl verify -CAfile intermediate/certs/ca-chain.cert.pem intermediate/certs/bob@example.com.cert.pem\n\nbob@example.com.cert.pem: OK\n```\n\nThe `index.txt` file should contain a new entry.\n\n```\nV 160420124740Z 1001 unknown ... /CN=bob@example.com\n```\n\nAlice sends Bob the signed certificate. Bob installs the certificate in his web browser and is now able to access Alice’s kitten pictures. Hurray!\n\nSadly, it turns out that Bob is misbehaving. Bob has posted Alice’s kitten pictures to Hacker News, claiming that they’re his own and gaining huge popularity. Alice finds out and needs to revoke his access immediately.\n\n```\ncd /root/ca\nopenssl ca -config intermediate/openssl.cnf -revoke intermediate/certs/bob@example.com.cert.pem\n\nEnter pass phrase for intermediate.key.pem: secretpassword\nRevoking Certificate 1001.\nData Base Updated\n```\n\nThe line in `index.txt` that corresponds to Bob’s certificate now begins with the character `R`. This means the certificate has been revoked.\n\n```\nR 160420124740Z 150411125310Z 1001 unknown ... /CN=bob@example.com\n```\n\nAfter revoking Bob’s certificate, Alice must re-create the CRL.\n\n\u003c/details\u003e\n\n### CRL'nin Sunucu Tarafında Kullanımı\n\nİstemci sertifikaları için, doğrulamayı yapan bir sunucu taraflı uygulama (örn. Apache) olur. Bu uygulamanın CRL'ye yerel erişimi olmalıdır.\n\nAlice'in durumunda, Apache yapılandırmasına 'SSLCARevocationPath' yönergesini ekleyebilir ve CRL'yi web sunucusuna kopyalayabilir. Bob, bir dahaki sefere Web sunucusuna bağlandığında Apache, istemci sertifikasını CRL'ye karşı kontrol eder ve erişimi reddeder.\n\nBenzer bir şekilde, OpenVPN sertifikalarını iptal eden istemcileri engelleyebilmek için bir `crl-verify` yönergesine sahiptir.\n\n\u003cdetails\u003e\n\n### Server-side use of the CRL\n\nFor client certificates, it’s typically a server-side application (eg, Apache) that is doing the verification. This application needs to have local access to the CRL.\n\nIn Alice’s case, she can add the `SSLCARevocationPath` directive to her Apache configuration and copy the CRL to her web server. The next time that Bob connects to the web server, Apache will check his client certificate against the CRL and deny access.\n\nSimilarly, OpenVPN has a `crl-verify` directive so that it can block clients that have had their certificates revoked.\n\n\u003c/details\u003e\n\n### CRL'nin İstemci Tarafında Kullanımı\n\nSunucu sertifikaları için, doğrulama işlemini gerçekleştiren bir istemci tarafı uygulaması (örn. Bir web tarayıcı) olur. Bu uygulamanın CRL'ye uzaktan erişimi olmalıdır.\n\nBir sertifika, `crlDistributionPoints` içeren bir uzantıyla imzalanmışsa, istemci tarafılı bir uygulama bu bilgiyi okuyabilir ve CRL'yi belirtilen konumdan getirir.\n\nCRL dağıtım noktaları, X509v3 sertifikasında ayrıntılı olarak görülebilir.\n\n```\nopenssl x509 -in cute-kitten-pictures.example.com.cert.pem -noout -text\n\n    X509v3 CRL Distribution Points:\n\n        Full Name:\n          URI:http://example.com/intermediate.crl.pem\n```\n\n\u003cdetails\u003e\n\n### Client-side use of the CRL\n\nFor server certificates, it’s typically a client-side application (eg, a web browser) that performs the verification. This application must have remote access to the CRL.\n\nIf a certificate was signed with an extension that includes `crlDistributionPoints`, a client-side application can read this information and fetch the CRL from the specified location.\n\nThe CRL distribution points are visible in the certificate X509v3 details.\n\n```\nopenssl x509 -in cute-kitten-pictures.example.com.cert.pem -noout -text\n\n    X509v3 CRL Distribution Points:\n\n        Full Name:\n          URI:http://example.com/intermediate.crl.pem\n```\n\n\u003c/details\u003e\n\n## Çevrimiçi Sertifika Durumu Protokolü\n\nÇevrimiçi Sertifika Durumu Protokolü (OCSP), sertifika iptal listelerine (CRL) alternatif olarak oluşturuldu. CRL'lere benzer şekilde, OCSP, bir sertifika iptal durumunu belirlemek için istek yapan tarafın (örneğin, bir web tarayıcısı) olmasını sağlar.\n\nBir CA; sertifika imzaladığında, sertifikaya genellikle bir OCSP sunucu adresi (örn., `http://ocsp.example.com`) ekleyecektir. Bu işlev, CRL'lerde kullanılan `crlDistributionPoints` ile benzerdir.\n\nÖrnek olarak, bir web tarayıcısı bir sunucu sertifikasıyla sunulduğunda, sertifikada belirtilen OCSP sunucu adresine bir sorgu gönderecektir. Bu adreste OCSP, sorguları dinler ve sertifikanın iptal durumuyla ilgili yanıtı verir.\n\n\u003e Not: Mümkün olduğunca OCSP kullanmanız önerilir, genelde web sitesi sertifikaları için OCSP'ye gereksinim duyacaksınız. Bazı web tarayıcıları, CRL desteğini kullanımdan kaldırmıştır.\n\n\u003cdetails\u003e\n\n## Online Certificate Status Protocol\n\nThe Online Certificate Status Protocol (OCSP) was created as an alternative to certificate revocation lists (CRLs). Similar to CRLs, OCSP enables a requesting party (eg, a web browser) to determine the revocation state of a certificate.\n\nWhen a CA signs a certificate, they will typically include an OCSP server address (eg, `http://ocsp.example.com`) in the certificate. This is similar in function to `crlDistributionPoints` used for CRLs.\n\nAs an example, when a web browser is presented with a server certificate, it will send a query to the OCSP server address specified in the certificate. At this address, an OCSP responder listens to queries and responds with the revocation status of the certificate.\n\n\u003e Note: It’s recommended to use OCSP instead where possible, though realistically you will tend to only need OCSP for website certificates. Some web browsers have deprecated or removed support for CRLs.\n\n\u003c/details\u003e\n\n### Yapılandırma Dosyasını Hazırlayın\n\nOCSP'yi kullanmak için CA, OCSP sunucu konumunu imzaladığı sertifikalara kodlamalıdır. Bizim durumumuzda `[server_cert]` bölümünde  `authorityInfoAccess` seçeneğini kullanın.\n\n```\n[ server_cert ]\n# ... snipped ...\nauthorityInfoAccess = OCSP;URI:http://ocsp.example.com\n```\n\n\u003cdetails\u003e\n\n### Prepare the configuration file\n\nTo use OCSP, the CA must encode the OCSP server location into the certificates that it signs. Use the `authorityInfoAccess` option in the appropriate sections, which in our case means the `[ server_cert ]` section.\n\n```\n[ server_cert ]\n# ... snipped ...\nauthorityInfoAccess = OCSP;URI:http://ocsp.example.com\n```\n\n\u003c/details\u003e\n\n### OCSP Çifti Oluşturun\n\nOCSP yanıtlayıcı, istekte bulunan kişiye gönderdiği yanıtı imzalamak için bir şifreleme çiftine ihtiyaç duyar. OCSP şifreleme çifti, kontrol edilen sertifikayı imzalayan aynı CA tarafından imzalanmış olmalıdır.\n\nÖzel bir anahtar oluşturun ve AES-256 şifrelemesi ile şifreleyin.\n\n```\ncd /root/ca\nopenssl genrsa -aes256 -out intermediate/private/ocsp.example.com.key.pem 4096\n```\n\nBir sertifika imzalama isteği (CSR) oluşturun. Ayrıntılar genellikle imzalayan CA ile eşleşmelidir. Bununla birlikte, Ortak Ad (**Common Name**) tam bir alan adı olmalıdır.\n\n```\ncd /root/ca\nopenssl req -config intermediate/openssl.cnf -new -sha256 -key intermediate/private/ocsp.example.com.key.pem \\\n      -out intermediate/csr/ocsp.example.com.csr.pem\n\nEnter pass phrase for intermediate.key.pem: secretpassword\nYou are about to be asked to enter information that will be incorporated\ninto your certificate request.\n-----\nCountry Name (2 letter code) [XX]:GB\nState or Province Name []:England\nLocality Name []:\nOrganization Name []:Alice Ltd\nOrganizational Unit Name []:Alice Ltd Certificate Authority\nCommon Name []:ocsp.example.com\nEmail Address []:\n```\n\nCSR'yi ara CA ile imzalayın.\n\n```\nopenssl ca -config intermediate/openssl.cnf -extensions ocsp -days 375 -notext -md sha256 \\\n      -in intermediate/csr/ocsp.example.com.csr.pem -out intermediate/certs/ocsp.example.com.cert.pem\n```\n\nSertifikanın doğru X509v3 uzantılarına sahip olduğunu doğrulayın.\n\n```\nopenssl x509 -noout -text -in intermediate/certs/ocsp.example.com.cert.pem\n\n    X509v3 Key Usage: critical\n        Digital Signature\n    X509v3 Extended Key Usage: critical\n        OCSP Signing\n```\n\n\u003cdetails\u003e\n\n### Create the OCSP pair\n\nThe OCSP responder requires a cryptographic pair for signing the response that it sends to the requesting party. The OCSP cryptographic pair must be signed by the same CA that signed the certificate being checked.\n\nCreate a private key and encrypt it with AES-256 encryption.\n\n```\ncd /root/ca\nopenssl genrsa -aes256 -out intermediate/private/ocsp.example.com.key.pem 4096\n```\n\nCreate a certificate signing request (CSR). The details should generally match those of the signing CA. The Common Name, however, must be a fully qualified domain name.\n\n```\ncd /root/ca\nopenssl req -config intermediate/openssl.cnf -new -sha256 -key intermediate/private/ocsp.example.com.key.pem \\\n      -out intermediate/csr/ocsp.example.com.csr.pem\n\nEnter pass phrase for intermediate.key.pem: secretpassword\nYou are about to be asked to enter information that will be incorporated\ninto your certificate request.\n-----\nCountry Name (2 letter code) [XX]:GB\nState or Province Name []:England\nLocality Name []:\nOrganization Name []:Alice Ltd\nOrganizational Unit Name []:Alice Ltd Certificate Authority\nCommon Name []:ocsp.example.com\nEmail Address []:\n```\n\nSign the CSR with the intermediate CA.\n\n```\nopenssl ca -config intermediate/openssl.cnf -extensions ocsp -days 375 -notext -md sha256 \\\n      -in intermediate/csr/ocsp.example.com.csr.pem -out intermediate/certs/ocsp.example.com.cert.pem\n```\n\nVerify that the certificate has the correct X509v3 extensions.\n\n```\nopenssl x509 -noout -text -in intermediate/certs/ocsp.example.com.cert.pem\n\n    X509v3 Key Usage: critical\n        Digital Signature\n    X509v3 Extended Key Usage: critical\n        OCSP Signing\n```\n\n\u003c/details\u003e\n\n### Bir Sertifikayı İptal Edin\n\nOpenSSL'in `ocsp` aracı bir OCSP cevaplayıcı olarak görev yapabilir, ancak sadece test amaçlıdır. Çerçek yayın ortamı (prodcution) için hazır OCSP yeteneklerine sahiptir, ancak bunlar bu kılavuzun kapsamı dışındadır.\n\nSınamak için bir sunucu sertifikası oluşturun.\n\n```\ncd /root/ca\nopenssl genrsa -out intermediate/private/test.example.com.key.pem 2048\nopenssl req -config intermediate/openssl.cnf -key intermediate/private/test.example.com.key.pem \\\n      -new -sha256 -out intermediate/csr/test.example.com.csr.pem\nopenssl ca -config intermediate/openssl.cnf -extensions server_cert -days 375 -notext -md sha256 \\\n      -in intermediate/csr/test.example.com.csr.pem \\\n      -out intermediate/certs/test.example.com.cert.pem\n```\n\nOCSP cevaplayıcıyı `localhost` üzerinde çalıştırın. İptalin durumunu ayrı bir CRL dosyasına kaydetmek yerine OCSP yanıtlayıcı `index.txt` dosyasını doğrudan okur. Yanıt OCSP şifreleme çifti ile imzalanmıştır (`-rkey` ve` -rsigner` seçenekleri kullanılarak).\n\n```\nopenssl ocsp -port 127.0.0.1:2560 -text -sha256 -index intermediate/index.txt -CA intermediate/certs/ca-chain.cert.pem \\\n      -rkey intermediate/private/ocsp.example.com.key.pem \\\n      -rsigner intermediate/certs/ocsp.example.com.cert.pem \\\n      -nrequest 1\n\nEnter pass phrase for ocsp.example.com.key.pem: secretpassword\n```\n\nBaşka bir terminalde, OCSP yanıtlayıcısına bir sorgu gönderin. `-cert` seçeneği, sorgulanacak sertifikayı belirtir.\n\n```\nopenssl ocsp -CAfile intermediate/certs/ca-chain.cert.pem -url http://127.0.0.1:2560 -resp_text \\\n      -issuer intermediate/certs/intermediate.cert.pem \\\n      -cert intermediate/certs/test.example.com.cert.pem\n```\n\nÇıktının başlangıcını şöyledir:\n\n* Başarılı bir cevap alındı mı (`OCSP Response Status`)\n* Yanıtlayıcı kimliği (`Responder Id`)\n* Sertifikanın iptal durumu (`Cert Status`)\n\n```\nOCSP Response Data:\n    OCSP Response Status: successful (0x0)\n    Response Type: Basic OCSP Response\n    Version: 1 (0x0)\n    Responder Id: ... CN = ocsp.example.com\n    Produced At: Apr 11 12:59:51 2015 GMT\n    Responses:\n    Certificate ID:\n      Hash Algorithm: sha1\n      Issuer Name Hash: E35979B6D0A973EBE8AEDED75D8C27D67D2A0334\n      Issuer Key Hash: 69E8EC547F252360E5B6E77261F1D4B921D445E9\n      Serial Number: 1003\n    Cert Status: good\n    This Update: Apr 11 12:59:51 2015 GMT\n```\n\nSertifikayı iptal et.\n\n```\nopenssl ca -config intermediate/openssl.cnf -revoke intermediate/certs/test.example.com.cert.pem\n\nEnter pass phrase for intermediate.key.pem: secretpassword\nRevoking Certificate 1003.\nData Base Updated\n```\n\nDaha önce olduğu gibi, OCSP yanıtlayıcıyı çalıştırın ve başka bir terminalde bir sorgu gönderin. Bu sefer, çıktıda `Cert Status: revoked` ve `Revocation Time` elde edilecektir.\n\n```\nOCSP Response Data:\n    OCSP Response Status: successful (0x0)\n    Response Type: Basic OCSP Response\n    Version: 1 (0x0)\n    Responder Id: ... CN = ocsp.example.com\n    Produced At: Apr 11 13:03:00 2015 GMT\n    Responses:\n    Certificate ID:\n      Hash Algorithm: sha1\n      Issuer Name Hash: E35979B6D0A973EBE8AEDED75D8C27D67D2A0334\n      Issuer Key Hash: 69E8EC547F252360E5B6E77261F1D4B921D445E9\n      Serial Number: 1003\n    Cert Status: revoked\n    Revocation Time: Apr 11 13:01:09 2015 GMT\n    This Update: Apr 11 13:03:00 2015 GMT\n```\n\n\u003cdetails\u003e\n\n### Revoke a certificate\n\nThe OpenSSL `ocsp` tool can act as an OCSP responder, but it’s only intended for testing. Production ready OCSP responders exist, but those are beyond the scope of this guide.\n\nCreate a server certificate to test.\n\n```\ncd /root/ca\nopenssl genrsa -out intermediate/private/test.example.com.key.pem 2048\nopenssl req -config intermediate/openssl.cnf -key intermediate/private/test.example.com.key.pem \\\n      -new -sha256 -out intermediate/csr/test.example.com.csr.pem\nopenssl ca -config intermediate/openssl.cnf -extensions server_cert -days 375 -notext -md sha256 \\\n      -in intermediate/csr/test.example.com.csr.pem \\\n      -out intermediate/certs/test.example.com.cert.pem\n```\n\nRun the OCSP responder on `localhost`. Rather than storing revocation status in a separate CRL file, the OCSP responder reads `index.txt` directly. The response is signed with the OCSP cryptographic pair (using the `-rkey` and `-rsigner` options).\n\n```\nopenssl ocsp -port 127.0.0.1:2560 -text -sha256 -index intermediate/index.txt -CA intermediate/certs/ca-chain.cert.pem \\\n      -rkey intermediate/private/ocsp.example.com.key.pem \\\n      -rsigner intermediate/certs/ocsp.example.com.cert.pem \\\n      -nrequest 1\n\nEnter pass phrase for ocsp.example.com.key.pem: secretpassword\n```\n\nIn another terminal, send a query to the OCSP responder. The `-cert` option specifies the certificate to query.\n\n```\nopenssl ocsp -CAfile intermediate/certs/ca-chain.cert.pem -url http://127.0.0.1:2560 -resp_text \\\n      -issuer intermediate/certs/intermediate.cert.pem \\\n      -cert intermediate/certs/test.example.com.cert.pem\n```\n\nThe start of the output shows:\n\n* whether a successful response was received (`OCSP Response Status`)\n* the identity of the responder (`Responder Id`)\n* the revocation status of the certificate (`Cert Status`)\n\n```\nOCSP Response Data:\n    OCSP Response Status: successful (0x0)\n    Response Type: Basic OCSP Response\n    Version: 1 (0x0)\n    Responder Id: ... CN = ocsp.example.com\n    Produced At: Apr 11 12:59:51 2015 GMT\n    Responses:\n    Certificate ID:\n      Hash Algorithm: sha1\n      Issuer Name Hash: E35979B6D0A973EBE8AEDED75D8C27D67D2A0334\n      Issuer Key Hash: 69E8EC547F252360E5B6E77261F1D4B921D445E9\n      Serial Number: 1003\n    Cert Status: good\n    This Update: Apr 11 12:59:51 2015 GMT\n```\n\nRevoke the certificate.\n\n```\nopenssl ca -config intermediate/openssl.cnf -revoke intermediate/certs/test.example.com.cert.pem\n\nEnter pass phrase for intermediate.key.pem: secretpassword\nRevoking Certificate 1003.\nData Base Updated\n```\n\nAs before, run the OCSP responder and on another terminal send a query. This time, the output shows `Cert Status: revoked` and a `Revocation Time`.\n\n```\nOCSP Response Data:\n    OCSP Response Status: successful (0x0)\n    Response Type: Basic OCSP Response\n    Version: 1 (0x0)\n    Responder Id: ... CN = ocsp.example.com\n    Produced At: Apr 11 13:03:00 2015 GMT\n    Responses:\n    Certificate ID:\n      Hash Algorithm: sha1\n      Issuer Name Hash: E35979B6D0A973EBE8AEDED75D8C27D67D2A0334\n      Issuer Key Hash: 69E8EC547F252360E5B6E77261F1D4B921D445E9\n      Serial Number: 1003\n    Cert Status: revoked\n    Revocation Time: Apr 11 13:01:09 2015 GMT\n    This Update: Apr 11 13:03:00 2015 GMT\n```\n\n\u003c/details\u003e\n\n## Ekler\n\n### Kök CA yapılandırma dosyası\n\n```\n# OpenSSL root CA configuration file.\n# Copy to `/root/ca/openssl.cnf`.\n\n[ ca ]\n# `man ca`\ndefault_ca = CA_default\n\n[ CA_default ]\n# Directory and file locations.\ndir               = /root/ca\ncerts             = $dir/certs\ncrl_dir           = $dir/crl\nnew_certs_dir     = $dir/newcerts\ndatabase          = $dir/index.txt\nserial            = $dir/serial\nRANDFILE          = $dir/private/.rand\n\n# The root key and root certificate.\nprivate_key       = $dir/private/ca.key.pem\ncertificate       = $dir/certs/ca.cert.pem\n\n# For certificate revocation lists.\ncrlnumber         = $dir/crlnumber\ncrl               = $dir/crl/ca.crl.pem\ncrl_extensions    = crl_ext\ndefault_crl_days  = 30\n\n# SHA-1 is deprecated, so use SHA-2 instead.\ndefault_md        = sha256\n\nname_opt          = ca_default\ncert_opt          = ca_default\ndefault_days      = 375\npreserve          = no\npolicy            = policy_strict\n\n[ policy_strict ]\n# The root CA should only sign intermediate certificates that match.\n# See the POLICY FORMAT section of `man ca`.\ncountryName             = match\nstateOrProvinceName     = match\norganizationName        = match\norganizationalUnitName  = optional\ncommonName              = supplied\nemailAddress            = optional\n\n[ policy_loose ]\n# Allow the intermediate CA to sign a more diverse range of certificates.\n# See the POLICY FORMAT section of the `ca` man page.\ncountryName             = optional\nstateOrProvinceName     = optional\nlocalityName            = optional\norganizationName        = optional\norganizationalUnitName  = optional\ncommonName              = supplied\nemailAddress            = optional\n\n[ req ]\n# Options for the `req` tool (`man req`).\ndefault_bits        = 2048\ndistinguished_name  = req_distinguished_name\nstring_mask         = utf8only\n\n# SHA-1 is deprecated, so use SHA-2 instead.\ndefault_md          = sha256\n\n# Extension to add when the -x509 option is used.\nx509_extensions     = v3_ca\n\n[ req_distinguished_name ]\n# See \u003chttps://en.wikipedia.org/wiki/Certificate_signing_request\u003e.\ncountryName                     = Country Name (2 letter code)\nstateOrProvinceName             = State or Province Name\nlocalityName                    = Locality Name\n0.organizationName              = Organization Name\norganizationalUnitName          = Organizational Unit Name\ncommonName                      = Common Name\nemailAddress                    = Email Address\n\n# Optionally, specify some defaults.\ncountryName_default             = GB\nstateOrProvinceName_default     = England\nlocalityName_default            =\n0.organizationName_default      = Alice Ltd\norganizationalUnitName_default  =\nemailAddress_default            =\n\n[ v3_ca ]\n# Extensions for a typical CA (`man x509v3_config`).\nsubjectKeyIdentifier = hash\nauthorityKeyIdentifier = keyid:always,issuer\nbasicConstraints = critical, CA:true\nkeyUsage = critical, digitalSignature, cRLSign, keyCertSign\n\n[ v3_intermediate_ca ]\n# Extensions for a typical intermediate CA (`man x509v3_config`).\nsubjectKeyIdentifier = hash\nauthorityKeyIdentifier = keyid:always,issuer\nbasicConstraints = critical, CA:true, pathlen:0\nkeyUsage = critical, digitalSignature, cRLSign, keyCertSign\n\n[ usr_cert ]\n# Extensions for client certificates (`man x509v3_config`).\nbasicConstraints = CA:FALSE\nnsCertType = client, email\nnsComment = \"OpenSSL Generated Client Certificate\"\nsubjectKeyIdentifier = hash\nauthorityKeyIdentifier = keyid,issuer\nkeyUsage = critical, nonRepudiation, digitalSignature, keyEncipherment\nextendedKeyUsage = clientAuth, emailProtection\n\n[ server_cert ]\n# Extensions for server certificates (`man x509v3_config`).\nbasicConstraints = CA:FALSE\nnsCertType = server\nnsComment = \"OpenSSL Generated Server Certificate\"\nsubjectKeyIdentifier = hash\nauthorityKeyIdentifier = keyid,issuer:always\nkeyUsage = critical, digitalSignature, keyEncipherment\nextendedKeyUsage = serverAuth\n\n[ crl_ext ]\n# Extension for CRLs (`man x509v3_config`).\nauthorityKeyIdentifier=keyid:always\n\n[ ocsp ]\n# Extension for OCSP signing certificates (`man ocsp`).\nbasicConstraints = CA:FALSE\nsubjectKeyIdentifier = hash\nauthorityKeyIdentifier = keyid,issuer\nkeyUsage = critical, digitalSignature\nextendedKeyUsage = critical, OCSPSigning\n```\n\n### Ara CA yapılandırma dosyası\n\n```\n# OpenSSL intermediate CA configuration file.\n# Copy to `/root/ca/intermediate/openssl.cnf`.\n\n[ ca ]\n# `man ca`\ndefault_ca = CA_default\n\n[ CA_default ]\n# Directory and file locations.\ndir               = /root/ca/intermediate\ncerts             = $dir/certs\ncrl_dir           = $dir/crl\nnew_certs_dir     = $dir/newcerts\ndatabase          = $dir/index.txt\nserial            = $dir/serial\nRANDFILE          = $dir/private/.rand\n\n# The root key and root certificate.\nprivate_key       = $dir/private/intermediate.key.pem\ncertificate       = $dir/certs/intermediate.cert.pem\n\n# For certificate revocation lists.\ncrlnumber         = $dir/crlnumber\ncrl               = $dir/crl/intermediate.crl.pem\ncrl_extensions    = crl_ext\ndefault_crl_days  = 30\n\n# SHA-1 is deprecated, so use SHA-2 instead.\ndefault_md        = sha256\n\nname_opt          = ca_default\ncert_opt          = ca_default\ndefault_days      = 375\npreserve          = no\npolicy            = policy_loose\n\n[ policy_strict ]\n# The root CA should only sign intermediate certificates that match.\n# See the POLICY FORMAT section of `man ca`.\ncountryName             = match\nstateOrProvinceName     = match\norganizationName        = match\norganizationalUnitName  = optional\ncommonName              = supplied\nemailAddress            = optional\n\n[ policy_loose ]\n# Allow the intermediate CA to sign a more diverse range of certificates.\n# See the POLICY FORMAT section of the `ca` man page.\ncountryName             = optional\nstateOrProvinceName     = optional\nlocalityName            = optional\norganizationName        = optional\norganizationalUnitName  = optional\ncommonName              = supplied\nemailAddress            = optional\n\n[ req ]\n# Options for the `req` tool (`man req`).\ndefault_bits        = 2048\ndistinguished_name  = req_distinguished_name\nstring_mask         = utf8only\n\n# SHA-1 is deprecated, so use SHA-2 instead.\ndefault_md          = sha256\n\n# Extension to add when the -x509 option is used.\nx509_extensions     = v3_ca\n\n[ req_distinguished_name ]\n# See \u003chttps://en.wikipedia.org/wiki/Certificate_signing_request\u003e.\ncountryName                     = Country Name (2 letter code)\nstateOrProvinceName             = State or Province Name\nlocalityName                    = Locality Name\n0.organizationName              = Organization Name\norganizationalUnitName          = Organizational Unit Name\ncommonName                      = Common Name\nemailAddress                    = Email Address\n\n# Optionally, specify some defaults.\ncountryName_default             = GB\nstateOrProvinceName_default     = England\nlocalityName_default            =\n0.organizationName_default      = Alice Ltd\norganizationalUnitName_default  =\nemailAddress_default            =\n\n[ v3_ca ]\n# Extensions for a typical CA (`man x509v3_config`).\nsubjectKeyIdentifier = hash\nauthorityKeyIdentifier = keyid:always,issuer\nbasicConstraints = critical, CA:true\nkeyUsage = critical, digitalSignature, cRLSign, keyCertSign\n\n[ v3_intermediate_ca ]\n# Extensions for a typical intermediate CA (`man x509v3_config`).\nsubjectKeyIdentifier = hash\nauthorityKeyIdentifier = keyid:always,issuer\nbasicConstraints = critical, CA:true, pathlen:0\nkeyUsage = critical, digitalSignature, cRLSign, keyCertSign\n\n[ usr_cert ]\n# Extensions for client certificates (`man x509v3_config`).\nbasicConstraints = CA:FALSE\nnsCertType = client, email\nnsComment = \"OpenSSL Generated Client Certificate\"\nsubjectKeyIdentifier = hash\nauthorityKeyIdentifier = keyid,issuer\nkeyUsage = critical, nonRepudiation, digitalSignature, keyEncipherment\nextendedKeyUsage = clientAuth, emailProtection\n\n[ server_cert ]\n# Extensions for server certificates (`man x509v3_config`).\nbasicConstraints = CA:FALSE\nnsCertType = server\nnsComment = \"OpenSSL Generated Server Certificate\"\nsubjectKeyIdentifier = hash\nauthorityKeyIdentifier = keyid,issuer:always\nkeyUsage = critical, digitalSignature, keyEncipherment\nextendedKeyUsage = serverAuth\n\n[ crl_ext ]\n# Extension for CRLs (`man x509v3_config`).\nauthorityKeyIdentifier=keyid:always\n\n[ ocsp ]\n# Extension for OCSP signing certificates (`man ocsp`).\nbasicConstraints = CA:FALSE\nsubjectKeyIdentifier = hash\nauthorityKeyIdentifier = keyid,issuer\nkeyUsage = critical, digitalSignature\nextendedKeyUsage = critical, OCSPSigning\n```\n\n\u003cdetails\u003e\n\n## Appendix\n\n### Root CA configuration file\n\n```\n# OpenSSL root CA configuration file.\n# Copy to `/root/ca/openssl.cnf`.\n\n[ ca ]\n# `man ca`\ndefault_ca = CA_default\n\n[ CA_default ]\n# Directory and file locations.\ndir               = /root/ca\ncerts             = $dir/certs\ncrl_dir           = $dir/crl\nnew_certs_dir     = $dir/newcerts\ndatabase          = $dir/index.txt\nserial            = $dir/serial\nRANDFILE          = $dir/private/.rand\n\n# The root key and root certificate.\nprivate_key       = $dir/private/ca.key.pem\ncertificate       = $dir/certs/ca.cert.pem\n\n# For certificate revocation lists.\ncrlnumber         = $dir/crlnumber\ncrl               = $dir/crl/ca.crl.pem\ncrl_extensions    = crl_ext\ndefault_crl_days  = 30\n\n# SHA-1 is deprecated, so use SHA-2 instead.\ndefault_md        = sha256\n\nname_opt          = ca_default\ncert_opt          = ca_default\ndefault_days      = 375\npreserve          = no\npolicy            = policy_strict\n\n[ policy_strict ]\n# The root CA should only sign intermediate certificates that match.\n# See the POLICY FORMAT section of `man ca`.\ncountryName             = match\nstateOrProvinceName     = match\norganizationName        = match\norganizationalUnitName  = optional\ncommonName              = supplied\nemailAddress            = optional\n\n[ policy_loose ]\n# Allow the intermediate CA to sign a more diverse range of certificates.\n# See the POLICY FORMAT section of the `ca` man page.\ncountryName             = optional\nstateOrProvinceName     = optional\nlocalityName            = optional\norganizationName        = optional\norganizationalUnitName  = optional\ncommonName              = supplied\nemailAddress            = optional\n\n[ req ]\n# Options for the `req` tool (`man req`).\ndefault_bits        = 2048\ndistinguished_name  = req_distinguished_name\nstring_mask         = utf8only\n\n# SHA-1 is deprecated, so use SHA-2 instead.\ndefault_md          = sha256\n\n# Extension to add when the -x509 option is used.\nx509_extensions     = v3_ca\n\n[ req_distinguished_name ]\n# See \u003chttps://en.wikipedia.org/wiki/Certificate_signing_request\u003e.\ncountryName                     = Country Name (2 letter code)\nstateOrProvinceName             = State or Province Name\nlocalityName                    = Locality Name\n0.organizationName              = Organization Name\norganizationalUnitName          = Organizational Unit Name\ncommonName                      = Common Name\nemailAddress                    = Email Address\n\n# Optionally, specify some defaults.\ncountryName_default             = GB\nstateOrProvinceName_default     = England\nlocalityName_default            =\n0.organizationName_default      = Alice Ltd\norganizationalUnitName_default  =\nemailAddress_default            =\n\n[ v3_ca ]\n# Extensions for a typical CA (`man x509v3_config`).\nsubjectKeyIdentifier = hash\nauthorityKeyIdentifier = keyid:always,issuer\nbasicConstraints = critical, CA:true\nkeyUsage = critical, digitalSignature, cRLSign, keyCertSign\n\n[ v3_intermediate_ca ]\n# Extensions for a typical intermediate CA (`man x509v3_config`).\nsubjectKeyIdentifier = hash\nauthorityKeyIdentifier = keyid:always,issuer\nbasicConstraints = critical, CA:true, pathlen:0\nkeyUsage = critical, digitalSignature, cRLSign, keyCertSign\n\n[ usr_cert ]\n# Extensions for client certificates (`man x509v3_config`).\nbasicConstraints = CA:FALSE\nnsCertType = client, email\nnsComment = \"OpenSSL Generated Client Certificate\"\nsubjectKeyIdentifier = hash\nauthorityKeyIdentifier = keyid,issuer\nkeyUsage = critical, nonRepudiation, digitalSignature, keyEncipherment\nextendedKeyUsage = clientAuth, emailProtection\n\n[ server_cert ]\n# Extensions for server certificates (`man x509v3_config`).\nbasicConstraints = CA:FALSE\nnsCertType = server\nnsComment = \"OpenSSL Generated Server Certificate\"\nsubjectKeyIdentifier = hash\nauthorityKeyIdentifier = keyid,issuer:always\nkeyUsage = critical, digitalSignature, keyEncipherment\nextendedKeyUsage = serverAuth\n\n[ crl_ext ]\n# Extension for CRLs (`man x509v3_config`).\nauthorityKeyIdentifier=keyid:always\n\n[ ocsp ]\n# Extension for OCSP signing certificates (`man ocsp`).\nbasicConstraints = CA:FALSE\nsubjectKeyIdentifier = hash\nauthorityKeyIdentifier = keyid,issuer\nkeyUsage = critical, digitalSignature\nextendedKeyUsage = critical, OCSPSigning\n```\n\n### Intermediate CA configuration file\n\n```\n# OpenSSL intermediate CA configuration file.\n# Copy to `/root/ca/intermediate/openssl.cnf`.\n\n[ ca ]\n# `man ca`\ndefault_ca = CA_default\n\n[ CA_default ]\n# Directory and file locations.\ndir               = /root/ca/intermediate\ncerts             = $dir/certs\ncrl_dir           = $dir/crl\nnew_certs_dir     = $dir/newcerts\ndatabase          = $dir/index.txt\nserial            = $dir/serial\nRANDFILE          = $dir/private/.rand\n\n# The root key and root certificate.\nprivate_key       = $dir/private/intermediate.key.pem\ncertificate       = $dir/certs/intermediate.cert.pem\n\n# For certificate revocation lists.\ncrlnumber         = $dir/crlnumber\ncrl               = $dir/crl/intermediate.crl.pem\ncrl_extensions    = crl_ext\ndefault_crl_days  = 30\n\n# SHA-1 is deprecated, so use SHA-2 instead.\ndefault_md        = sha256\n\nname_opt          = ca_default\ncert_opt          = ca_default\ndefault_days      = 375\npreserve          = no\npolicy            = policy_loose\n\n[ policy_strict ]\n# The root CA should only sign intermediate certificates that match.\n# See the POLICY FORMAT section of `man ca`.\ncountryName             = match\nstateOrProvinceName     = match\norganizationName        = match\norganizationalUnitName  = optional\ncommonName              = supplied\nemailAddress            = optional\n\n[ policy_loose ]\n# Allow the intermediate CA to sign a more diverse range of certificates.\n# See the POLICY FORMAT section of the `ca` man page.\ncountryName             = optional\nstateOrProvinceName     = optional\nlocalityName            = optional\norganizationName        = optional\norganizationalUnitName  = optional\ncommonName              = supplied\nemailAddress            = optional\n\n[ req ]\n# Options for the `req` tool (`man req`).\ndefault_bits        = 2048\ndistinguished_name  = req_distinguished_name\nstring_mask         = utf8only\n\n# SHA-1 is deprecated, so use SHA-2 instead.\ndefault_md          = sha256\n\n# Extension to add when the -x509 option is used.\nx509_extensions     = v3_ca\n\n[ req_distinguished_name ]\n# See \u003chttps://en.wikipedia.org/wiki/Certificate_signing_request\u003e.\ncountryName                     = Country Name (2 letter code)\nstateOrProvinceName             = State or Province Name\nlocalityName                    = Locality Name\n0.organizationName              = Organization Name\norganizationalUnitName          = Organizational Unit Name\ncommonName                      = Common Name\nemailAddress                    = Email Address\n\n# Optionally, specify some defaults.\ncountryName_default             = GB\nstateOrProvinceName_default     = England\nlocalityName_default            =\n0.organizationName_default      = Alice Ltd\norganizationalUnitName_default  =\nemailAddress_default            =\n\n[ v3_ca ]\n# Extensions for a typical CA (`man x509v3_config`).\nsubjectKeyIdentifier = hash\nauthorityKeyIdentifier = keyid:always,issuer\nbasicConstraints = critical, CA:true\nkeyUsage = critical, digitalSignature, cRLSign, keyCertSign\n\n[ v3_intermediate_ca ]\n# Extensions for a typical intermediate CA (`man x509v3_config`).\nsubjectKeyIdentifier = hash\nauthorityKeyIdentifier = keyid:always,issuer\nbasicConstraints = critical, CA:true, pathlen:0\nkeyUsage = critical, digitalSignature, cRLSign, keyCertSign\n\n[ usr_cert ]\n# Extensions for client certificates (`man x509v3_config`).\nbasicConstraints = CA:FALSE\nnsCertType = client, email\nnsComment = \"OpenSSL Generated Client Certificate\"\nsubjectKeyIdentifier = hash\nauthorityKeyIdentifier = keyid,issuer\nkeyUsage = critical, nonRepudiation, digitalSignature, keyEncipherment\nextendedKeyUsage = clientAuth, emailProtection\n\n[ server_cert ]\n# Extensions for server certificates (`man x509v3_config`).\nbasicConstraints = CA:FALSE\nnsCertType = server\nnsComment = \"OpenSSL Generated Server Certificate\"\nsubjectKeyIdentifier = hash\nauthorityKeyIdentifier = keyid,issuer:always\nkeyUsage = critical, digitalSignature, keyEncipherment\nextendedKeyUsage = serverAuth\n\n[ crl_ext ]\n# Extension for CRLs (`man x509v3_config`).\nauthorityKeyIdentifier=keyid:always\n\n[ ocsp ]\n# Extension for OCSP signing certificates (`man ocsp`).\nbasicConstraints = CA:FALSE\nsubjectKeyIdentifier = hash\nauthorityKeyIdentifier = keyid,issuer\nkeyUsage = critical, digitalSignature\nextendedKeyUsage = critical, OCSPSigning\n```\n\n\u003c/details\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzekiunal%2Fopenssl-certificate-authority-guide","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzekiunal%2Fopenssl-certificate-authority-guide","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzekiunal%2Fopenssl-certificate-authority-guide/lists"}