python script - is the connection http or https ?

Stuart Henderson stu at
Sat Feb 8 12:48:38 UTC 2020

On 2020/02/08 13:36, dy1977--- via Unbound-users wrote:
> Hello,
> we are using unbound an Internet filter, which is a critical applacation now
> to protect children (and not only...) from some dangers of Internet. The
> filter is working fine, thanks for the help already received. There is still
> a desired improvement.
> When a domain is forbidden, the python script replies with a valid DNS
> answer, directed to an error page. No problem in http. But in https, the
> result is a warning from the browser since it receives a certificate which
> is not valid for the requested domain. It is better in this case to return a
> Now my question : is it possible to know if the connection is http or https
> ? It would allow to choose the best option for each case.
> Thanks
> Dysmas

It is not.

What you could do is not answer https on the error page, then rather than
having an TLS error there will just be a "site can't be reached" error.

More information about the Unbound-users mailing list