This shows you the differences between two versions of the page.
Next revision | Previous revision Next revision Both sides next revision | ||
informatica:servidor_internet_2009_http_to_https_rediris [2022/09/27 17:15] miquel created |
informatica:servidor_internet_2009_http_to_https_rediris [2022/09/28 17:24] miquel [Generar un fitxer CSR i clau amb OpenSSL] |
||
---|---|---|---|
Line 14: | Line 14: | ||
En aquesta pàgina se'ns proposa fer servir l'eina [[https:// | En aquesta pàgina se'ns proposa fer servir l'eina [[https:// | ||
- | | + | | OpenSSL CSR Wizard]] de [[http:// |
< | < | ||
Line 20: | Line 20: | ||
</ | </ | ||
- | per generar una sol·licitud per signatura de certificat (CSR) per '' | + | per generar una sol·licitud per signatura de certificat (CSR) per "sermn.uab.cat". El problema és que només permet generar el CSR per " |
+ | |||
+ | Així doncs, hauré de generar el fitxer CSR a mà amb el programa '' | ||
+ | |||
+ | < | ||
+ | * Includes support for multiple domain names (comma separated) | ||
+ | * First domain name listed is used as the Common Name | ||
+ | * All domain names entered are added as Subject Alternative Names | ||
+ | * Choose from a 2048 bit RSA Key or 256 bit ECC Key | ||
+ | * SHA-256 is used as the signature hash | ||
+ | * Copy/Paste or download CSR and private key | ||
+ | * CSR and key are generated using best practices and industry standards to avoid browser errors | ||
+ | * The OpenSSL commands are shown and can be executed securely on a local system | ||
+ | * Additional customizations and more powerful features are available using the [[https:// | ||
+ | < | ||
+ | https:// | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | |||
+ | ==== Generar un fitxer CSR i clau amb OpenSSL ==== | ||
+ | |||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | |||
+ | |||
+ | ==== Generar un fitxer CSR i clau amb CSR Generator de CertificateTools.com ==== | ||
+ | |||
+ | Provo a generar un CSR amb la següent informació: | ||
+ | |||
+ | * **Domain name:** sermn.uab.cat, | ||
+ | * **Country: | ||
+ | * **State:** Catalunya | ||
+ | * **Locality: | ||
+ | * **Organization: | ||
+ | |||
+ | que equival a aquesta configuració: | ||
+ | |||
+ | < | ||
+ | [ req ] | ||
+ | default_md = sha256 | ||
+ | prompt = no | ||
+ | req_extensions = req_ext | ||
+ | distinguished_name = req_distinguished_name | ||
+ | [ req_distinguished_name ] | ||
+ | commonName = sermn.uab.cat | ||
+ | countryName = ES | ||
+ | stateOrProvinceName = Catalunya | ||
+ | localityName = Bellaterra, Cerdanyola del Valles | ||
+ | organizationName = Universitat Autonoma de Barcelona | ||
+ | [ req_ext ] | ||
+ | keyUsage=critical, | ||
+ | extendedKeyUsage=serverAuth, | ||
+ | subjectAltName = @alt_names | ||
+ | [ alt_names ] | ||
+ | DNS.0 = sermn.uab.cat | ||
+ | DNS.1 = sermn.uab.es | ||
+ | DNS.2 = rmn3.uab.cat | ||
+ | DNS.3 = rmn3.uab.es | ||
+ | </ | ||
+ | |||
+ | Un cop generats els fitxers '' | ||
+ | |||
+ | === Fitxer CSR generat === | ||
+ | |||
+ | < | ||
+ | $ openssl req -text -noout -verify -in cert.csr | ||
+ | verify OK | ||
+ | Certificate Request: | ||
+ | Data: | ||
+ | Version: 1 (0x0) | ||
+ | Subject: CN = sermn.uab.cat, | ||
+ | Subject Public Key Info: | ||
+ | Public Key Algorithm: rsaEncryption | ||
+ | RSA Public-Key: (2048 bit) | ||
+ | Modulus: | ||
+ | 00: | ||
+ | 7d: | ||
+ | 7f: | ||
+ | a2: | ||
+ | cf: | ||
+ | 6c: | ||
+ | f0: | ||
+ | db: | ||
+ | 3f: | ||
+ | 18: | ||
+ | 05: | ||
+ | e3: | ||
+ | bf: | ||
+ | 3f: | ||
+ | 3d: | ||
+ | a6: | ||
+ | 59: | ||
+ | 09:07 | ||
+ | Exponent: 65537 (0x10001) | ||
+ | Attributes: | ||
+ | Requested Extensions: | ||
+ | X509v3 Key Usage: critical | ||
+ | Digital Signature, Key Encipherment | ||
+ | X509v3 Extended Key Usage: | ||
+ | TLS Web Server Authentication, | ||
+ | X509v3 Subject Alternative Name: | ||
+ | DNS: | ||
+ | Signature Algorithm: sha256WithRSAEncryption | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | |||
+ | |||
+ | === Fitxer clau generat === | ||
+ | |||
+ | < | ||
+ | $ openssl rsa -in priv.key -check | ||
+ | RSA key ok | ||
+ | writing RSA key | ||
+ | -----BEGIN RSA PRIVATE KEY----- | ||
+ | |||
+ | [removed] | ||
+ | |||
+ | -----END RSA PRIVATE KEY----- | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | ==== Sol·licitar un certificat a través del SI de la UAB ==== | ||
+ | |||
+ | Faig servir el servei " | ||
+ | |||
+ | < | ||
+ | Sol·licitud de certificats per a servidors del domini UAB (nom_servidor.uab.cat i nom_servidor.uab.es). Aquests certificats els gestiona la xarxa acadèmica de l' | ||
+ | |||
+ | El Servei d' | ||
+ | |||
+ | Actualment el servei el proporciona l' | ||
+ | |||
+ | < | ||
+ | https:// | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | per sol·licitar un certificat a partir del CSR generat anteriorment amb les següents opcions: | ||
+ | |||
+ | * **Responsable diferent del sol·licitant: | ||
+ | * **Durada del certificat (en anys):** 2 | ||
+ | * **Tipus de Servidor:** Apache/ | ||
+ | |||
+ | i envio la sol·licitud. | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
- | Així doncs, hauré de generar el fitxer CSR a mà amb el programa '' | ||