{"id":52,"date":"2015-01-16T19:49:36","date_gmt":"2015-01-16T18:49:36","guid":{"rendered":"http:\/\/xv6.de\/?page_id=52"},"modified":"2019-10-17T09:36:07","modified_gmt":"2019-10-17T08:36:07","slug":"openssl-configuration","status":"publish","type":"page","link":"http:\/\/xv6.de\/?page_id=52","title":{"rendered":"OpenSSL Configuration"},"content":{"rendered":"<p>A configuration file is required to define the basic operation of OpenSSL. It is possible to use the system config file or a configuration file may be specified on the command line while working with OpenSSL commands. The later approach was chosen. Next step is the creation of a basic OpenSSL configuration file that will be used to create the certificates.<\/p>\n<ol>\n<li>Create a file openssl.cnf<code><br \/>\n$ touch openssl.cnf<\/code><\/li>\n<li>Edit the created configuration file and add some content<code><br \/>\nHOME = \/srv\/pki<\/p>\n<p>[ ca ]<br \/>\ndefault_ca                     = CA-default<\/p>\n<p>[ CA-default ]<br \/>\ndir                            = $HOME\/CA-root<br \/>\nRANDFILE                       = $HOME\/.rand<br \/>\ndatabase                       = $dir\/index.txt<br \/>\nserial                         = $dir\/serial<br \/>\nprivate_key=$dir\/ca.key<br \/>\ncertificate                    = $dir\/ca.crt<br \/>\nnew_certs_dir                  = $dir\/new_certs<br \/>\ncerts                          = $dir\/certs<br \/>\npolicy                         = policy_match_root<br \/>\nx509_extensions                = extension_root_cert<\/p>\n<p>[ policy_match_root ]<br \/>\ncountryName                    = optional<br \/>\nstateOrProvinceName            = optional<br \/>\norganizationName               = optional<br \/>\norganizationalUnitName         = optional<br \/>\ncommonName                     = supplied<br \/>\nemailAddress                   = optional<\/p>\n<p>[ extension_root_cert ]<br \/>\nbasicConstraints               = CA:true<br \/>\nsubjectKeyIdentifier           = hash<br \/>\nauthorityKeyIdentifier         = keyid,issuer:always<\/p>\n<p><\/code><code><\/code><\/li>\n<li>Create a rand file <em>.rnd<\/em> <code><br \/>\n$ openssl rand -out .rnd -base64 2048<br \/>\n<\/code><\/li>\n<li>Create Diffie hellman parameter file <em>dh2048<\/em> <code><br \/>\n$ openssl dhparam -out dh2048.pem 2048<br \/>\n<\/code><\/li>\n<li> Create private key and selfsigned certificate for the Root CA <code><br \/>\n$ openssl req -new -x509 -config openssl.cnf -days 3650 -set_serial 0 -newkey rsa:2048 -out CA-root\/ca.crt -keyout CA-root\/ca.key<br \/>\n<\/code><\/li>\n<li>View the Root CA certificate  created in the previous step <code><br \/>\n$ openssl x509 -in CA-root\/ca.crt -noout -text<br \/>\n<\/code><\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>A configuration file is required to define the basic operation of OpenSSL. It is possible to use the system config file or a configuration file may be specified on the command line while working with OpenSSL commands. The later approach was chosen. Next step is the creation of a basic OpenSSL configuration file that will &hellip; <a href=\"http:\/\/xv6.de\/?page_id=52\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">OpenSSL Configuration<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":19,"menu_order":0,"comment_status":"closed","ping_status":"open","template":"","meta":{"footnotes":""},"class_list":["post-52","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"http:\/\/xv6.de\/index.php?rest_route=\/wp\/v2\/pages\/52","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/xv6.de\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/xv6.de\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/xv6.de\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/xv6.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=52"}],"version-history":[{"count":8,"href":"http:\/\/xv6.de\/index.php?rest_route=\/wp\/v2\/pages\/52\/revisions"}],"predecessor-version":[{"id":144,"href":"http:\/\/xv6.de\/index.php?rest_route=\/wp\/v2\/pages\/52\/revisions\/144"}],"up":[{"embeddable":true,"href":"http:\/\/xv6.de\/index.php?rest_route=\/wp\/v2\/pages\/19"}],"wp:attachment":[{"href":"http:\/\/xv6.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=52"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}