--- title: SCM-Server Configuration subtitle: Various configuration options for the SCM-Server displayToc: true --- ## Https In order to use https with scm-server, you need a keystore with a certificate and the corresponding secret key. In the following we will use `openssl` to create a self signed certificate for demonstration purposes. ### Create self signed certificate **Warning**: Do not use self signed certificates in production, this is only for demonstration purposes. ```bash openssl req -new -x509 -newkey rsa:2048 -sha256 -keyout tls.key -out tls.crt ``` This command will ask a few questions about metadata for generated certificate: * PEM pass phrase: This is a password to protect the scret key * Country Name (2 letter code) * State or Province Name (full name) * Locality Name (eg, city) * Organization Name (eg, company) * Organizational Unit Name (eg, section) * Common Name (eg, fully qualified host name) * Email Address Make sure that the common name matches the fqdn, which you are using to access SCM-Manager. #### Browsers In order to use a self signed certificate the certificate must be imported into you browser. #### Configure Git To use git with a self signed certificate, we have to add the certificate path to the configuration. ```bash git config http.sslCAInfo /complete/path/to/tls.crt ``` #### Configure Mercurial To use mercurial with a self signed certificate, we have to add the certificate path to the configuration. ```ini [web] cacerts = /complete/path/to/cert.pem ``` ### Create keystore Create a keystore in pkcs12 format. This command can be used with the self signed certificate from above or with a valid certificate from an authority. ```bash openssl pkcs12 -inkey tls.key -in tls.crt -export -out keystore.pkcs12 ``` If your secret key is protected with a pass phrase, you have to enter it first. Than you have to enter an export password to protect your keystore. ### Server configuration Add the following snippet at the end of your `server-config.xml`, be sure it is inside the `Configure` tag: ```xml /conf/keystore.pkcs12 PKCS12 secret TLSv1.2 TLSv1.3 TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 http/1.1 ``` The snipped above assumes your keystore is in the pkcs12 format and is stored at `conf/keystore.pkcs12` with the password `secret`. You have to tweek this settings to match your setup. After modifying your `server-config.xml`, you have to **restart** your SCM-Manager instance. Now SCM-Manager should open a second port with **https** (in the example above **8443**).