Why does stunnel keep throwing "Address already in use (48)"?

Viewed 300

I am working on implementing Auth0 in a Django project, using stunnel to create the https connection. I followed this instruction

This is my dev_https file:

pid=

cert = stunnel/stunnel.pem
foreground = yes
output = stunnel.log

[https]
accept=8080
connect=8000
TIMEOUTclose=1

However, when I want to start the server, using this command:

stunnel stunnel/dev_https &
python3 manage.py runserver&

I get the following:

[.] Configuration successful
[ ] Deallocating deployed section defaults
[ ] Binding service [https]
[ ] Listening file descriptor created (FD=9)
[ ] Setting accept socket options (FD=9)
[ ] Option SO_REUSEADDR set on accept socket
[.] Binding service [https] to :::8080: Address already in use (48)
[ ] Listening file descriptor created (FD=9)
[ ] Setting accept socket options (FD=9)
[ ] Option SO_REUSEADDR set on accept socket
[.] Binding service [https] to 0.0.0.0:8080: Address already in use (48)
[!] Binding service [https] failed

I tried changing the accept port from 8443 to 8080. Same result

I then checked for active processes on the port with

lsof -i 8080

This reveals that stunnel is already running on the port. I killed that process and tried again, but I get the same error.

Specific questions

  1. Can someone briefly explain the reqeuest flow between the accept and connect ports, and how this relates to the normal port that I run Django on (port 8000)?
  2. How do I fix this?

Thank you! /Thomas

0 Answers
Related