0

I have an IMAP server running on Ubuntu 22.04.2 LTS. I am able to connect successfully to this server using openssl s_client -connect 127.0.0.1:8000 -crlf .

I am trying to access this server from inside a docker (version 24.0.0) container running on the same machine. I have used this post to set up the networking and included

extra_hosts:
    - "host.docker.internal:host-gateway"

in my docker-compose.yml for the relevant container. I am able to ping the host using curl host.docker.internal:80, correctly displaying the nginx page of the host. However, trying to access the IMAP server using openssl s_client -connect host.docker.internal:8000 -crlf results in the following error:

481BA4E8D57F0000:error:8000006F:system library:BIO_connect:Connection refused:crypto/bio/bio_sock2.c:114:calling connect()
481BA4E8D57F0000:error:10000067:BIO routines:BIO_connect:connect error:crypto/bio/bio_sock2.c:116:
connect:errno=111

Using this post I have tried to debug the issue. I use UFW as a firewall but have disabled it whilst debugging. netstat -tulpn on the host machine shows tcp 0 0 127.0.0.1:8000 0.0.0.0:* LISTEN 38233/bridge which I believe means the IMAP server is listening on all interfaces.

I have searched extensively and have been unable to find a solution to this.

user190245
  • 1,027
  • 1
  • 15
  • 31
MTR
  • 1
  • 1

0 Answers0