# Creating a certificate for PgBouncer

**URL:** https://community.letsencrypt.org/t/creating-a-certificate-for-pgbouncer/221373
**Category:** Help
**Created:** [July 7, 2024, 9:09am UTC](https://community.letsencrypt.org/t/creating-a-certificate-for-pgbouncer/221373 "2024-07-07T09:09:18Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Sibert](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@Sibert](https://community.letsencrypt.org/u/Sibert)
#### Post date: [July 7, 2024, 9:09am UTC](https://community.letsencrypt.org/t/creating-a-certificate-for-pgbouncer/221373/1 "2024-07-07T09:09:18Z")

</div>

I am trying to create a Let's Encrypt certificate for PgBouncer. Not a website.

1. Is it even possible to create a cert for PgBouncer separately?
2. How do I create a DNS challenge separately?

The problem is that my website has a redirect for all incoming calls that NOT is a "valid page".  
This seems to make certbot confused and hence refuse to create a certificate or DNS challenge.

`Invalid response from https://adjob.se/hacker: "<!DOCTYPE html>\n<html lang=\"en\">`

The version of my client is certbot 2.1.0

---

<div class="post-metadata">

### Author: ![MikeMcQ](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/mikemcq/32/52772_2.png) [@MikeMcQ](https://community.letsencrypt.org/u/MikeMcQ)
#### Post date: [July 7, 2024, 11:45am UTC](https://community.letsencrypt.org/t/creating-a-certificate-for-pgbouncer/221373/2 "2024-07-07T11:45:27Z")

</div>

> [@Sibert](#):
>
> Is it even possible to create a cert for PgBouncer separately?

Let's Encrypt issues certs for domain names. I see that `adjob.se` is proxied behind Cloudflare. Do you use that domain name to access PgBouncer?

If so, do you already have a cert for that domain name on your Origin server?

If not, what is the domain name?

The PgBouncer docs explain setting up TLS and certs. So once you have a cert it looks like it should work

> [@Sibert](#):
>
> How do I create a DNS challenge separately?

Not sure what you mean by "separately". But, if PgBouncer is accessed using the `adjob.se` domain you could use the cert you already have.

If you need a different cert you can use a DNS Challenge with Cloudflare. See [Welcome to certbot-dns-cloudflare’s documentation! — certbot-dns-cloudflare 0 documentation](https://certbot-dns-cloudflare.readthedocs.io/en/stable/)

It is hard to say much more without more details from you

---

<div class="post-metadata">

### Author: ![Sibert](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@Sibert](https://community.letsencrypt.org/u/Sibert)
#### Post date: [July 7, 2024, 3:43pm UTC](https://community.letsencrypt.org/t/creating-a-certificate-for-pgbouncer/221373/3 "2024-07-07T15:43:36Z")

</div>

> [@MikeMcQ](#):
>
> If so, do you already have a cert for that domain name on your Origin server?

Actually this is pre-web.

A desktop client accessing Postgresql. And I plan to use PgBouncer in front of Postgresql. So on this VPS there is nothing else than the database and PgBouncer.

> [@](#):
>
> It is hard to say much more without more details from you

My main question was if Let's Encrypt works for PgBouncer?  
I do not know what the domain has to do with this - other than verifying.

---

<div class="post-metadata">

### Author: ![MikeMcQ](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/mikemcq/32/52772_2.png) [@MikeMcQ](https://community.letsencrypt.org/u/MikeMcQ)
#### Post date: [July 7, 2024, 3:55pm UTC](https://community.letsencrypt.org/t/creating-a-certificate-for-pgbouncer/221373/4 "2024-07-07T15:55:05Z")

</div>

> [@Sibert](#):
>
> I do not know what the domain has to do with this - other than verifying.

A cert is needed for the TLS connection. A _Let's Encrypt_ cert is only issued for publicly validated domain names. An LE cert is intended for TLS clients to validate they are talking with the intended server.

If you don't need a domain validated cert couldn't you just use a self-signed cert?

> [@Sibert](#):
>
> My main question was if Let's Encrypt works for PgBouncer?

You'd have to ask the PgBouncer people for the specifics of any cert specs they require. I didn't see anything unusual in their docs but I just skimmed them. I'd say "almost certainly" but the question lacks detail 🙂

---

<div class="post-metadata">

### Author: ![system](https://global.discourse-cdn.com/letsencrypt/original/3X/c/a/ca6c06ea1ea201324bba7048c6841ce60236468d.png) [@system](https://community.letsencrypt.org/u/system)
#### Post date: [August 6, 2024, 3:55pm UTC](https://community.letsencrypt.org/t/creating-a-certificate-for-pgbouncer/221373/5 "2024-08-06T15:55:06Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
