0

So I have run my server using django-sslserver (pip install django-sslserver)

python manage.py runsslserver xx.xx.x.xx:443

Now I can visit the site on the server itself, but if I try to visit it from another machine, it times out. Looking at the command prompt, the server doesn't seem to even know about my request from the other machine.

But if I run the server with

python manage.py runserver xx.xx.x.xx:80

I can visit it from both machines no problem. With the ssl, I've tried a number of ports, it makes no difference. Here is the output on startup (with IP replaced):

c:\Users\Foo\Project>python manage.py runsslserver xx.xx.x.xx:443
Validating models...

System check identified no issues (0 silenced).
March 24, 2017 - 13:24:59
Django version 1.10.6, using settings 'Project.settings'
Starting development server at https://xx.xx.x.xx:443/
Using SSL certificate: C:\Users\Foo\AppData\Local\Programs\Python\Python35\lib\site-packages\sslserver\certs\development.crt
Using SSL key: C:\Users\Foo\AppData\Local\Programs\Python\Python35\lib\site-packages\sslserver\certs\development.key
Quit the server with CTRL-BREAK.
Andrew
  • 1,571
  • 17
  • 31
  • What is `runsslserver` ? It's not a built-in Django command so either you have written it yourself, in which case you should show the code, or it's a third-party thing, in which case you should link to the source. – Daniel Roseman Mar 24 '17 at 17:50
  • https://pypi.python.org/pypi/django-sslserver/0.19 – Andrew Mar 24 '17 at 17:53
  • OK. What does it print as it starts up? – Daniel Roseman Mar 24 '17 at 17:58
  • @DanielRoseman updated the question with the output – Andrew Mar 24 '17 at 18:04
  • I don't use external packages like django-sslserver. I use stunnel to run local ssl django development server. Checkout my answer https://stackoverflow.com/a/60667888/9384511 – ABN Aug 17 '21 at 09:05

2 Answers2

0

My first guess would be that your two machines are on different networks, and that the reported address from your server machine is really just its internal address after Network Address Translation (NAT). If that's the case, then your server doesn't actually have any IP address at all outside it's own little network.

Again, if that's what's happening, you'll want to change your router's settings to give that machine a static IP address, and then to forward the server's port along to that specific machine. Of course, how you do that exactly depends upon your router.

Andrew Miner
  • 5,587
  • 2
  • 22
  • 26
  • But wouldn't the regular server also fail if that were the case? runsslserver only works locally, but runserver works on both. – Andrew Mar 24 '17 at 17:55
  • Maybe not. Since HTTPS and HTTP use different ports, your network may be configured for one but not the other. Hard to say with what data you've presented so far. I'm not even 100% sure that's really your problem. – Andrew Miner Mar 24 '17 at 17:58
0

Here's how I fixed it. However, I have been advised to use apache or something else instead.

  1. Go to Windows Firewall with Advance Security.
  2. Click "New Rule..."
  3. Click Port
  4. Click Next
  5. Enter port 443
  6. Click Next
  7. Click "Allow the connection"
  8. Click Next
  9. Click Next
  10. Enter a name
  11. Click Finish
Andrew
  • 1,571
  • 17
  • 31