<commit_before>---
title: Using ThoughtWorks Go with custom certificates
layout: default
---

# Using \#gocd (ThoughtWorks Go) with custom certificates

The following post will help you setting up [Go](http://www.go.cd) to use your custom certificate instead of the self-signed certificate that Go ships with.

> Assumption: You have the certificate key (*.key) and certificate (*.crt)

## Step 1: Converting your certificate (*.crt) into PKCS12 format

If you have the key and certificate, you should export them to the pkcs12 format by running

```
$ openssl pkcs12 -inkey goserver.key -in goserver.crt -export -out goserver.pkcs12
```

## Step 2: Importing the pkcs12 into the Java Keystore

Once you have the goserver.pkcs12 file, you would need to import this keystore into the java keystore that Go uses. We will use the **keytool** utility that ships with Java.

> Note: Destination keystore password **must** be set to **serverKeyst<PASSWORD>**

```
$ keytool -importkeystore -srckeystore goserver.pkcs12 -srcstoretype PKCS12 -destkeystore keystore
Enter destination keystore password: <PASSWORD><commit_msg>changing case for a title<commit_after>---
title: Using ThoughtWorks Go with custom certificates
layout: default
---

# Using \#gocd (ThoughtWorks Go) with custom certificates

The following post will help you setting up [Go](http://www.go.cd) to use your custom certificate instead of the self-signed certificate that Go ships with.

> Assumption: You have the certificate key (*.key) and certificate (*.crt)

## Step 1: Converting your certificate (*.crt) into PKCS12 format

If you have the key and certificate, you should export them to the pkcs12 format by running

```
$ openssl pkcs12 -inkey goserver.key -in goserver.crt -export -out goserver.pkcs12
```

## Step 2: Importing the PKCS12 store into the Java Keystore

Once you have the goserver.pkcs12 file, you would need to import this keystore into the java keystore that Go uses. We will use the **keytool** utility that ships with Java.

> Note: Destination keystore password **must** be set to **<PASSWORD>Ke<PASSWORD>**

```
$ keytool -importkeystore -srckeystore goserver.pkcs12 -srcstoretype PKCS12 -destkeystore keystore
Enter destination keystore password: <PASSWORD>
{'fraction_non_alphanumeric': 0.0844069302532208, 'fraction_numerical': 0.015992892047978675, 'mean_word_length': 4.63, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6717280', 'n_tokens_mistral': 704, 'n_tokens_neox': 643, 'n_words': 296}