I am trying to start my server using https, so I installed django-sslserver
and executed as shown below.
python manage.py runsslserver --certificate /etc/ssl/certs/server.crt --key /etc/ssl/private/server.key 0.0.0.0:8000
He successfully works with the above team. I can access through localhost:8000
or 127.0.0.1:8000
, but could not access through 192.168.2.13:8000
here 192.168.2.13
- this is my IP address.
Why can't I access through my IP address?
And even if you start the server with a different port 8000
, it defaults to value 8000
. Here in the example below I used 8014
, but accepted 8000
by default.
root@nagapavan-HP-ProBook-440-G2:/home/nagapavan/Downloads/celestial_NAS
Validating models...
System check identified some issues:
WARNINGS:
NAS.UserProfile.user: (fields.W342) Setting unique=True on a ForeignKey has the same effect as using a OneToOneField.
HINT: ForeignKey(unique=True) is usually better served by a OneToOneField.
System check identified 1 issue (0 silenced).
October 06, 2015 - 13:21:40
Django version 1.8.4, using settings 'celestial_NAS.settings'
Starting development server at 127.0.0.1:8000/
Using SSL certificate: /etc/ssl/certs/server.crt
Using SSL key: /etc/ssl/private/server.key
Quit the server with CONTROL-C
Why does he take the default port number 8000?
, . IP- . , . IP-, localhost:9000
127.0.0.1:9000
, .
?
IP- https://192.168.2.13:9000
, , ( pingable )
? - ?
python manage.py runsslserver --certificate /etc/ssl/certs/server.c --key /etc/ssl/private/server.key --addrport 192.168.2.13:9000
.. URI, , https
, sslserver, :
?
Exception happened during processing of request from ('192.168.1.166', 56694)
Traceback (most recent call last):
File "/usr/lib/python2.7/SocketServer.py", line 295, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 321, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/local/lib/python2.7/dist-packages/django/core/servers/basehttp.py", line 102, in __init__
super(WSGIRequestHandler, self).__init__(*args, **kwargs)
File "/usr/lib/python2.7/SocketServer.py", line 649, in __init__
self.handle()
File "/usr/local/lib/python2.7/dist-packages/django/core/servers/basehttp.py", line 167, in handle
self.raw_requestline = self.rfile.readline(65537)
File "/usr/lib/python2.7/socket.py", line 476, in readline
data = self._sock.recv(self._rbufsize)
File "/usr/lib/python2.7/ssl.py", line 341, in recv
return self.read(buflen)
File "/usr/lib/python2.7/ssl.py", line 260, in read
return self._sslobj.read(len)
SSLError: [Errno 1] _ssl.c:1429: error:14094418:SSL routines:SSL3_READ_BYTES:tlsv1 alert unknown ca