DoH with custom Bind9 server

Hi.

I’m trying to configure DNS over HTTPS with my RouterOS and a custom installed Bind9 DNS server that I host outside my network.

I have a self-signed certificate on the server (as I’m accessing it through the IP address), but everytime I try to send a DNS query I’m getting an error from RouterOS saying:

DoH server connection error: remote disconnected while in HTTP exchange

I’ve imported the server certificate and CA, but still having the same error.

When I remove the server certificate and CA from the imported certificates, I’m getting the following error, so I assume the certificate is well imported…
DoH server connection error: SSL: ssl: no trusted CA certificate found

Any ideas? Thanks!