Pihole v6 not using trusted certificates

Hi For me the pihole v6 is not connecting at all, due to changes in pihole, most of the users will now have a selfsigned cert and https mode instead of http, I guess that's the problem too for me, how can I enable connections to unverified (seflsigned) https certs? Also a little side note, I think in piholev6 it's not called api password, it's just the login password, except one specifically creates an app passwort.
Solution:
OMG I screwed up and used fetch instead of fetchWithTrustedCertificatesAsync in the factory
Jump to solution
35 Replies
Cakey Bot
Cakey Bot6d ago
Thank you for submitting a support request. Depending on the volume of requests, our team should get in contact with you shortly.
⚠️ Please include the following details in your post or we may reject your request without further comment: - Log (See https://homarr.dev/docs/community/faq#how-do-i-open-the-console--log) - Operating system (Unraid, TrueNAS, Ubuntu, ...) - Exact Homarr version (eg. 0.15.0, not latest) - Configuration (eg. docker-compose, screenshot or similar. Use ``your-text`` to format) - Other relevant information (eg. your devices, your browser, ...)
Frequently Asked Questions | Homarr documentation
Can I install Homarr on a Raspberry Pi?
Manicraft1001
Manicraft10016d ago
You should trust the certificate using this: https://homarr.dev/docs/management/certificates/
Certificates | Homarr documentation
On this page you can manage your trusted certificates.
Manicraft1001
Manicraft10016d ago
Can you post your logs? Would be useful to us to confirm that the certificate is self signed and the issue.
Meierschlumpf
Meierschlumpf6d ago
Regarding the change from api-key to passwords, from our docs: Please note, that in v6 of PiHole you no longer specify an API key, but instead either a password or application password. We suggest to use the application password when possible. https://homarr.dev/docs/integrations/dns#pihole
DNS | Homarr documentation
Homarr allows the integration of DHS-holes to control them and display their stats.
CrazyWolf13
CrazyWolf13OP6d ago
perfect, was just confused, because it's still called API-Key on the UI, but not a problem for me ^^ done, wow that's awesome, to be able to trust certs directly via UI! Though I could successfully import the CA cert, that did not solve my issue :/
Manicraft1001
Manicraft10016d ago
Did you wait a bit or manually run the task? It should work if you imported the correct certificate
CrazyWolf13
CrazyWolf13OP6d ago
<< mutation #2 integration.create
Object { input: {…}, result: TRPCClientError, elapsedMs: 27, context: {} }
2855-d7df72897ab6a825.js:1:24737
<< mutation #3 integration.create
Object { input: {…}, result: TRPCClientError, elapsedMs: 27, context: {} }
2855-d7df72897ab6a825.js:1:24737
<< mutation #4 integration.create
Object { input: {…}, result: TRPCClientError, elapsedMs: 23, context: {} }
2855-d7df72897ab6a825.js:1:24737
<< mutation #5 integration.create
Object { input: {…}, result: TRPCClientError, elapsedMs: 25, context: {} }
2855-d7df72897ab6a825.js:1:24737
Uncaught (in promise) TRPCClientError: fetch failed
NextJS 40
Caused by: undefined
8898-a70234ca8e14a784.js:1:28777
<< mutation #2 integration.create
Object { input: {…}, result: TRPCClientError, elapsedMs: 27, context: {} }
2855-d7df72897ab6a825.js:1:24737
<< mutation #3 integration.create
Object { input: {…}, result: TRPCClientError, elapsedMs: 27, context: {} }
2855-d7df72897ab6a825.js:1:24737
<< mutation #4 integration.create
Object { input: {…}, result: TRPCClientError, elapsedMs: 23, context: {} }
2855-d7df72897ab6a825.js:1:24737
<< mutation #5 integration.create
Object { input: {…}, result: TRPCClientError, elapsedMs: 25, context: {} }
2855-d7df72897ab6a825.js:1:24737
Uncaught (in promise) TRPCClientError: fetch failed
NextJS 40
Caused by: undefined
8898-a70234ca8e14a784.js:1:28777
get this in browser console, does that help?
Manicraft1001
Manicraft10016d ago
No, it does not help What certificate did you import? (do not upload, just say how you obtained it)
CrazyWolf13
CrazyWolf13OP6d ago
the tls_ca.crt downloaded via sftp from /etc/pihole
Manicraft1001
Manicraft10016d ago
And this is what the webserver of PiHole uses?
Manicraft1001
Manicraft10016d ago
Does webserver.api.tls.cert exist (see https://docs.pi-hole.net/api/tls/#using-your-own-certificate )?
CrazyWolf13
CrazyWolf13OP6d ago
no
Manicraft1001
Manicraft10016d ago
And does this certificate, you downloaded, match with the one your browser shows when accessing PiHole?
CrazyWolf13
CrazyWolf13OP6d ago
yeah matches. though I'm a bit confused, normally such integrations take some seconds to load, however if I hit create integration/test integration, it IMMEDIATELY goes to that error
Manicraft1001
Manicraft10016d ago
Can you open the container shell and perform a wget to PiHole? Is the response as expected or is there some proxy response?
CrazyWolf13
CrazyWolf13OP6d ago
Yeah definitely:
root@homarr:~# wget https://10.10.20.15
--2025-03-06 21:36:34-- https://10.10.20.15/
Connecting to 10.10.20.15:443... connected.
ERROR: The certificate of ‘10.10.20.15’ is not trusted.
ERROR: The certificate of ‘10.10.20.15’ doesn't have a known issuer.
The certificate's owner does not match hostname ‘10.10.20.15’
root@homarr:~# wget --no-check-certificate https://10.10.20.15
--2025-03-06 21:37:04-- https://10.10.20.15/
Connecting to 10.10.20.15:443... connected.
WARNING: The certificate of ‘10.10.20.15’ is not trusted.
WARNING: The certificate of ‘10.10.20.15’ doesn't have a known issuer.
The certificate's owner does not match hostname ‘10.10.20.15’
HTTP request sent, awaiting response... 403 Forbidden
2025-03-06 21:37:04 ERROR 403: Forbidden.

root@homarr:~# wget --no-check-certificate https://10.10.20.15/admin
--2025-03-06 21:37:16-- https://10.10.20.15/admin
Connecting to 10.10.20.15:443... connected.
WARNING: The certificate of ‘10.10.20.15’ is not trusted.
WARNING: The certificate of ‘10.10.20.15’ doesn't have a known issuer.
The certificate's owner does not match hostname ‘10.10.20.15’
HTTP request sent, awaiting response... 308 Permanent Redirect
Location: /admin/ [following]
--2025-03-06 21:37:16-- https://10.10.20.15/admin/
Connecting to 10.10.20.15:443... connected.
WARNING: The certificate of ‘10.10.20.15’ is not trusted.
WARNING: The certificate of ‘10.10.20.15’ doesn't have a known issuer.
The certificate's owner does not match hostname ‘10.10.20.15’
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘admin’

admin [ <=> ] 34.74K --.-KB/s in 0.004s

2025-03-06 21:37:17 (9.51 MB/s) - ‘admin’ saved [35572]
root@homarr:~# wget https://10.10.20.15
--2025-03-06 21:36:34-- https://10.10.20.15/
Connecting to 10.10.20.15:443... connected.
ERROR: The certificate of ‘10.10.20.15’ is not trusted.
ERROR: The certificate of ‘10.10.20.15’ doesn't have a known issuer.
The certificate's owner does not match hostname ‘10.10.20.15’
root@homarr:~# wget --no-check-certificate https://10.10.20.15
--2025-03-06 21:37:04-- https://10.10.20.15/
Connecting to 10.10.20.15:443... connected.
WARNING: The certificate of ‘10.10.20.15’ is not trusted.
WARNING: The certificate of ‘10.10.20.15’ doesn't have a known issuer.
The certificate's owner does not match hostname ‘10.10.20.15’
HTTP request sent, awaiting response... 403 Forbidden
2025-03-06 21:37:04 ERROR 403: Forbidden.

root@homarr:~# wget --no-check-certificate https://10.10.20.15/admin
--2025-03-06 21:37:16-- https://10.10.20.15/admin
Connecting to 10.10.20.15:443... connected.
WARNING: The certificate of ‘10.10.20.15’ is not trusted.
WARNING: The certificate of ‘10.10.20.15’ doesn't have a known issuer.
The certificate's owner does not match hostname ‘10.10.20.15’
HTTP request sent, awaiting response... 308 Permanent Redirect
Location: /admin/ [following]
--2025-03-06 21:37:16-- https://10.10.20.15/admin/
Connecting to 10.10.20.15:443... connected.
WARNING: The certificate of ‘10.10.20.15’ is not trusted.
WARNING: The certificate of ‘10.10.20.15’ doesn't have a known issuer.
The certificate's owner does not match hostname ‘10.10.20.15’
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘admin’

admin [ <=> ] 34.74K --.-KB/s in 0.004s

2025-03-06 21:37:17 (9.51 MB/s) - ‘admin’ saved [35572]
Manicraft1001
Manicraft10016d ago
Can you post the output of "admin"? cat admin
Manicraft1001
Manicraft10016d ago
@Meierschlumpf can you take another look? Are you sure that we properly fetch?
Solution
Meierschlumpf
Meierschlumpf6d ago
OMG I screwed up and used fetch instead of fetchWithTrustedCertificatesAsync in the factory
Meierschlumpf
Meierschlumpf6d ago
Will be fixed tomorrow evening
Meierschlumpf
Meierschlumpf6d ago
There is also another problem once the fetch --> withTrustedCertificates is fixed: Hostname/IP does not match certificate's altnames: Host: localhost. is not in the cert's altnames: DNS:pi.hole Their certificate only allows pi.hole as domain
CrazyWolf13
CrazyWolf13OP6d ago
but that's something homarr side, not something I'd have to change right?
Meierschlumpf
Meierschlumpf6d ago
No that's something pi-hole site 😐
CrazyWolf13
CrazyWolf13OP6d ago
but I guess most people would have this problem right? Is it possible to get a don't verify https cert chckbox? Or what would need to be changed pihole side?
Meierschlumpf
Meierschlumpf6d ago
Their certificate would need to be a wildcard certificate I would guess. But maybe it's configurable somehow? Okay there is a field webserver.domain in their toml configuration. I'll test if it is possible to define multiple domains Nope not possible to define multiple domains. Not even * is possible... We'll need to find a good solution for this, because I don't like to disable the full verification. Maybe we can disable just the domain check for all uploaded custom certificates, but I'll need to research what security implication this has
CrazyWolf13
CrazyWolf13OP3d ago
Yeah agreed! Thanks for looking into this quickly @Meierschlumpf Thanks for the v1.10 release, I just updated and checked, though I still cannot create a new pi-hole integration Here the new log:
Mar 09 19:44:25 homarr run_homarr.sh[163]: 2025-03-09T18:44:25.835Z info: tRPC request from nextjs-react (json) by user 'tobias (1d7697da-d2b6-4381-8612-3941932dfd87)'
Mar 09 19:44:25 homarr run_homarr.sh[163]: 2025-03-09T18:44:25.840Z info: Dispatching request https://10.10.20.15/api/info/version (5 headers)
Mar 09 19:44:25 homarr run_homarr.sh[163]: 2025-03-09T18:44:25.881Z error: tRPC Error with mutation on 'integration.create': (INTERNAL_SERVER_ERROR) - fetch failed
Mar 09 19:44:25 homarr run_homarr.sh[163]: TypeError: fetch failed
Mar 09 19:44:25 homarr run_homarr.sh[163]: at e.exports.hd (/opt/homarr/apps/nextjs/.next/server/chunks/7726.js:1:129676)
Mar 09 19:44:25 homarr run_homarr.sh[163]: at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
Mar 09 19:44:25 homarr run_homarr.sh[163]: at async Array.ix (/opt/homarr/apps/nextjs/.next/server/chunks/760.js:6:14241)
Mar 09 19:44:25 homarr run_homarr.sh[163]: at async iC (/opt/homarr/apps/nextjs/.next/server/chunks/760.js:6:16210)
Mar 09 19:44:25 homarr run_homarr.sh[163]: at async sa (/opt/homarr/apps/nextjs/.next/server/chunks/760.js:7:219)
Mar 09 19:44:25 homarr run_homarr.sh[163]: at async /opt/homarr/apps/nextjs/.next/server/chunks/760.js:7:3315
Mar 09 19:44:25 homarr run_homarr.sh[163]: at async l.middlewares (/opt/homarr/apps/nextjs/.next/server/chunks/4058.js:114:94810)
Mar 09 19:44:25 homarr run_homarr.sh[163]: at async p (/opt/homarr/apps/nextjs/.next/server/chunks/4058.js:117:68)
Mar 09 19:44:25 homarr run_homarr.sh[163]: at async p (/opt/homarr/apps/nextjs/.next/server/chunks/4058.js:117:68)
Mar 09 19:44:25 homarr run_homarr.sh[163]: at async p (/opt/homarr/apps/nextjs/.next/server/chunks/4058.js:117:68)
Mar 09 19:44:25 homarr run_homarr.sh[163]: TypeError: fetch failed
Mar 09 19:44:25 homarr run_homarr.sh[163]: 2025-03-09T18:44:25.835Z info: tRPC request from nextjs-react (json) by user 'tobias (1d7697da-d2b6-4381-8612-3941932dfd87)'
Mar 09 19:44:25 homarr run_homarr.sh[163]: 2025-03-09T18:44:25.840Z info: Dispatching request https://10.10.20.15/api/info/version (5 headers)
Mar 09 19:44:25 homarr run_homarr.sh[163]: 2025-03-09T18:44:25.881Z error: tRPC Error with mutation on 'integration.create': (INTERNAL_SERVER_ERROR) - fetch failed
Mar 09 19:44:25 homarr run_homarr.sh[163]: TypeError: fetch failed
Mar 09 19:44:25 homarr run_homarr.sh[163]: at e.exports.hd (/opt/homarr/apps/nextjs/.next/server/chunks/7726.js:1:129676)
Mar 09 19:44:25 homarr run_homarr.sh[163]: at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
Mar 09 19:44:25 homarr run_homarr.sh[163]: at async Array.ix (/opt/homarr/apps/nextjs/.next/server/chunks/760.js:6:14241)
Mar 09 19:44:25 homarr run_homarr.sh[163]: at async iC (/opt/homarr/apps/nextjs/.next/server/chunks/760.js:6:16210)
Mar 09 19:44:25 homarr run_homarr.sh[163]: at async sa (/opt/homarr/apps/nextjs/.next/server/chunks/760.js:7:219)
Mar 09 19:44:25 homarr run_homarr.sh[163]: at async /opt/homarr/apps/nextjs/.next/server/chunks/760.js:7:3315
Mar 09 19:44:25 homarr run_homarr.sh[163]: at async l.middlewares (/opt/homarr/apps/nextjs/.next/server/chunks/4058.js:114:94810)
Mar 09 19:44:25 homarr run_homarr.sh[163]: at async p (/opt/homarr/apps/nextjs/.next/server/chunks/4058.js:117:68)
Mar 09 19:44:25 homarr run_homarr.sh[163]: at async p (/opt/homarr/apps/nextjs/.next/server/chunks/4058.js:117:68)
Mar 09 19:44:25 homarr run_homarr.sh[163]: at async p (/opt/homarr/apps/nextjs/.next/server/chunks/4058.js:117:68)
Mar 09 19:44:25 homarr run_homarr.sh[163]: TypeError: fetch failed
Meierschlumpf
Meierschlumpf3d ago
Does your certificate contain the ip 10.10.20.15 as allowed record? If not you'll need to change that. As I said we would need to reduce security if we want to ignore the domain of the certificates, which we don't want
CrazyWolf13
CrazyWolf13OP3d ago
as pihole autogenerates this I don't have that much influence over this, but seems like only pi.hole is made valid: Also I don't really think I will be the only one to encounter this, as nearly everywhere pihole autogenerated self-signed ssl certs.
No description
Meierschlumpf
Meierschlumpf3d ago
Yes I know, as I said, we can not really do something about it except removing some security aspects. As Pi-Hole previously was http only I think it might make sense to just add one or two checkboxes to ignore domain and or ignore certificate errors altogheter
CrazyWolf13
CrazyWolf13OP3d ago
yeah I guess the option for the domain check could be configurable, though importing the CA_cert was actually quite easy, though I leave that up to you to decide.
Meierschlumpf
Meierschlumpf3d ago
GitHub
feat: add checkboxes to remove certificate checks · Issue #2553 · h...
Describe the feature you'd like to request Add two new checkboxes to the integration creation page Checkbox to ignore certificate check altogether with rejectUnauthorized: false Checkbox to dia...
CrazyWolf13
CrazyWolf13OP3d ago
perfect, thanks

Did you find this page helpful?