> For the complete documentation index, see [llms.txt](https://oci-pronghorn.gitbook.io/greenlightning/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://oci-pronghorn.gitbook.io/greenlightning/chapter-2-configuration/tls-certificates.md).

# TLS Certificates

## Using Certificates

### Default Certificates

You can use the default provided certificate:

```java
TLSCertificates certs = TLSCertificates.defaultCerts;
```

�Which has the following values:

```java
public static class Default implements TLSCertificates {
    public Default() {
    }

    public String keyStoreResourceName() {
        return "/certificates/client.jks";
    }

    public String trustStroreResourceName() {
        return "/certificates/trustedCerts.jks";
    }

    public String keyStorePassword() {
        return "storepass";
    }

    public String keyPassword() {
        return "keypass";
    }

    public boolean trustAllCerts() {
        return true;
    }
}
```

These certificates are shipped with GreenLightning by default.

### Custom Certificates

To specify custom TLS certificates, use the code below. Your .jks files should be located under your applications resources folder.

```java
TLSCertificates certs = new TLSCertificates() {
   @Override
   public String keyStoreResourceName() {
      return "/certificates/CUSTOM_CLIENT.jks";
   }

   @Override
   public String trustStroreResourceName() {
      return "/certificates/CUSTOM_TRUSTED.jks";
   }

   @Override
   public String keyStorePassword() {
      return "STOREPASSWORD";
   }

   @Override
   public String keyPassword() {
      return "KEYPASSWORD";
   }

   @Override
   public boolean trustAllCerts() {
      return true;
   }
};
```

�
