# 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;
   }
};
```

�


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://oci-pronghorn.gitbook.io/greenlightning/chapter-2-configuration/tls-certificates.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
