IIS 8 HttpPlatformHandler + Python (Flask/Tornado) = Permission Error

1,058 views
Skip to first unread message

Darren Chuck

unread,
Apr 27, 2016, 7:44:27 AM4/27/16
to Tornado Web Server
I am running a webapp (flask wsgi) on tornado. Standalone script runs fine. When it is integrated into IIS 8 with HttpPlatformHandler we get this error:

Traceback (most recent call last):
 
File "D:\webapp\myapp\app.py", line 2, in <module>
   
import tornado.web
 
File "C:\python\Python35\lib\site-packages\tornado\web.py", line 86, in <module>
   
from tornado import iostream
 
File "C:\python\Python35\lib\site-packages\tornado\iostream.py", line 40, in <module>
   
from tornado.netutil import ssl_wrap_socket, ssl_match_hostname, SSLCertificateError, _client_ssl_defaults, _server_ssl_defaults
 
File "C:\python\Python35\lib\site-packages\tornado\netutil.py", line 68, in <module>
    ssl
.Purpose.SERVER_AUTH)
 
File "C:\python\Python35\lib\ssl.py", line 470, in create_default_context
    context
.load_default_certs(purpose)
 
File "C:\python\Python35\lib\ssl.py", line 421, in load_default_certs
   
self._load_windows_store_certs(storename, purpose)
 
File "C:\python\Python35\lib\ssl.py", line 408, in _load_windows_store_certs
   
for cert, encoding, trust in enum_certificates(storename):
PermissionError: [WinError 5] Access is denied


The web.config file looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
 
<system.webServer>
   
<handlers>
     
<add name="httpplatformhandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified"/>
   
</handlers>
   
<httpPlatform processPath="C:\python\Python35\python.exe"
 
arguments="D:\webapp\myapp\app.py"
 
stdoutLogEnabled="true" stdoutLogFile="d:\webapp\log\log.txt">
   
</httpPlatform>
 
</system.webServer>
</configuration>

How can this be fixed? Thanks.

Phyo Arkar

unread,
Apr 30, 2016, 4:48:56 AM4/30/16
to Tornado Web Server
Why there is need to put it on an IIS server? 
Tornado is best Run on Linux. Tornado is a lot faster and more compatible at linux.
For permission errors , its simple , check permissions.


--
You received this message because you are subscribed to the Google Groups "Tornado Web Server" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-tornad...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Andy Shapiro

unread,
Nov 4, 2016, 2:52:34 PM11/4/16
to Tornado Web Server
You may need to add requireAccess:

<add name="httpplatformhandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" requireAccess="Script"/>

I also had to install/enable ASP4.5, after installing httpPlatformHandler 1.2.
Reply all
Reply to author
Forward
0 new messages