cherrypy

How to block SSL protocols in favor of TLS?

北战南征 提交于 2019-11-27 16:14:16
How can I block SSL protocols in PyOpenSSL in favour of TLS ? I'm using CentOS 7 and have these versions: pyOpenSSL-0.13.1-3.el7.x86_64 openssl-1.0.1e-34.el7_0.7.x86_64 In my config file (this if for a CherryPy app) I have: 'server.ssl_module': 'pyopenssl', This is really good question for CherryPy today. This month we started discussing SSL issues and overall maintainability of CherryPy's wrappers over py2.6+ ssl and pyOpenSSL in CherryPy user group . I'm planning a topic about SSL issues there, so you can subscribe for the group to get more details later. For now, here's what is possible. I

How do I configure the ip address with CherryPy?

ぐ巨炮叔叔 提交于 2019-11-27 14:39:57
I'm using python and CherryPy to create a simple internal website that about 2 people use. I use the built in webserver with CherryPy.quickstart and never messed with the config files. I recently changed machines so I installed the latest Python and cherrypy and when I run the site I can access it from localhost:8080 but not through the IP or the windows machine name. It could be a machine configuration difference or a newer version of CherryPy or Python. Any ideas how I can bind to the correct IP address? Edit: to make it clear, I currently don't have a config file at all. That depends on how

CherryPy with Cheetah as plugin + tool - blank pages

烂漫一生 提交于 2019-11-27 08:30:18
问题 CherryPy keeps returning blank pages or with the values I return in the controllers. I rewrote a django and jinja2 version that did work, apparently this one doesn't which is almost identical to the previous mentioned. I did some pprint's in the tool bit which does fill the request.body with parsed html but doesn't output it when pass is set in the controller. If I return a {'user':True} in the controller that is shown in the form of a simple "User". with a few examples online and the code of

Cherrypy : which solutions for pages with large processing time

冷暖自知 提交于 2019-11-27 06:23:18
问题 I have a website powered by cherrypy. For some pages, I need quite a long processing time (a multi-join SQL request on a several-million-row DB). The processing needs sometimes 20 seconds or more, and the browser get crashed because it is too long. I'm wondering what would be a nice solution here. 回答1: Everything here depends on a volume of the website. CherryPy is a threaded server and once every thread is waiting for database, new requests won't be processed. There's also aspect of request

How to open a web server port on EC2 instance

时光怂恿深爱的人放手 提交于 2019-11-26 21:57:41
I'm running a CherryPy web server at 0.0.0.0:8787 on an EC2 instance. I can connect to the web server via local wget on the EC2 machine, but I can't reach the instance from my own remote machine (I connect to EC2 via ssh). Do I need to open up port 8787 to access the web server remotely? If so, how can this be done? Also, can I use the public IP of the EC2 instance for this? cyraxjoe Follow the steps that are described on this answer just instead of using the drop down, type the port (8787) in "port range" an then "Add rule". Go to the "Network & Security" -> Security Group settings in the

How to block SSL protocols in favor of TLS?

自古美人都是妖i 提交于 2019-11-26 18:37:19
问题 How can I block SSL protocols in PyOpenSSL in favour of TLS ? I'm using CentOS 7 and have these versions: pyOpenSSL-0.13.1-3.el7.x86_64 openssl-1.0.1e-34.el7_0.7.x86_64 In my config file (this if for a CherryPy app) I have: 'server.ssl_module': 'pyopenssl', 回答1: This is really good question for CherryPy today. This month we started discussing SSL issues and overall maintainability of CherryPy's wrappers over py2.6+ ssl and pyOpenSSL in CherryPy user group. I'm planning a topic about SSL

How to receive JSON in a POST request in CherryPy?

雨燕双飞 提交于 2019-11-26 12:38:49
问题 How to receive JSON from POST requests in CherryPy? I\'ve been to this page, and though it does a good job explaining the API, its parameters, and what it does; I can\'t seem to figure out how to use them to parse the incoming JSON into an object. Here\'s what I have so far: import cherrypy import json from web.models.card import card from web.models.session import getSession from web.controllers.error import formatEx, handle_error class CardRequestHandler(object): @cherrypy.expose def update

How to open a web server port on EC2 instance

孤街醉人 提交于 2019-11-26 07:28:58
问题 I\'m running a CherryPy web server at 0.0.0.0:8787 on an EC2 instance. I can connect to the web server via local wget on the EC2 machine, but I can\'t reach the instance from my own remote machine (I connect to EC2 via ssh). Do I need to open up port 8787 to access the web server remotely? If so, how can this be done? Also, can I use the public IP of the EC2 instance for this? 回答1: Follow the steps that are described on this answer just instead of using the drop down, type the port (8787) in

Post JSON using Python Requests

与世无争的帅哥 提交于 2019-11-25 22:23:22
问题 I need to POST a JSON from a client to a server. I\'m using Python 2.7.1 and simplejson. The client is using Requests. The server is CherryPy. I can GET a hard-coded JSON from the server (code not shown), but when I try to POST a JSON to the server, I get \"400 Bad Request\". Here is my client code: data = {\'sender\': \'Alice\', \'receiver\': \'Bob\', \'message\': \'We did it!\'} data_json = simplejson.dumps(data) payload = {\'json_payload\': data_json} r = requests.post(\"http://localhost

How to get a cross-origin resource sharing (CORS) post request working

十年热恋 提交于 2019-11-25 21:55:12
问题 I have a machine on my local lan (machineA) that has two web servers. The first is the in-built one in XBMC (on port 8080) and displays our library. The second server is a CherryPy python script (port 8081) that I am using to trigger a file conversion on demand. The file conversion is triggered by a AJAX POST request from the page served from the XBMC server. Goto http://machineA:8080 which displays library Library is displayed User clicks on \'convert\' link which issues the following