Vultaire's Blog

CherryPy missing documentation: Enabling client certificate verification

CherryPy is a convenient pure-Python web server that provides a good host for WSGI applications. It’s seemingly one of the few Python WSGI web servers which allows for SSL without depending on a separate web server, which is quite attractive for cross-platform apps. (I think Tornado is another notable example which does this, but Tornado is not the best platform for WSGI, despite technically supporting it.)

Getting basic SSL up and running is not particularly hard; it is easy enough to google the CherryPy docs and find this. However, deeper configuration is not exactly clear. One such option is client certificate verification. Indeed, I thought that due to the presence of this bug that it was not presently possible to enable this out of the box in CherryPy.

Thankfully I was wrong; indeed it is possible, it just does not appear to be documented. So, here’s the missing documentation.

This post assumes CherryPy 12.0.0 and cheroot 5.9.1.


Embedded Python: How to use it effectively


I wanted to write a little about this, as I feel that the embedded Python distribution available since Python 3.5 is perhaps underappreciated by many in the community.

As an experienced Python dev, I understand the benefits of using a properly installed Python, or using virtualenvs. And I agree that those should be the main ways that developers, especially more inexperienced ones, should work with Python.

However, the embedded Python distribution has obvious benefits for certain cases. For example, if you want to distribute software in Python but don’t want to compile it to an EXE using py2exe or similar, using the embedded environment is an excellent way to enable end users to use your software without needing to know that the software is necessarily written in Python, or at least to not need to install a Python environment prior to using it, or to simply have a clean and isolated Python distribution which won’t interfere with others in the system.

For those who understand this, I think it’s perfectly fine to leverage this environment.

However, there’s a few issues with the embedded environment which can be cumbersome and annoying.

Here’s a few of them:


Embeddable Python distribution hack: include code outside the embedded distro path

Here’s a method for tweaking the “embeddable zip file” distributions of Python to allow you to import code outside of the extracted Python environment. This may be useful for a number of reasons, such as wanting to keep your code separate from the Python “core” code. In my particular case, I have a project I’m Read more about Embeddable Python distribution hack: include code outside the embedded distro path[…]

#Cronut? Experimenting with Ray Cronise’s weight loss methodology

Going to try to keep this quick.

For those who know me in real life, I’m overweight. Since graduating college, I’ve been as high as around 320-330, and as low as 182 (thanks to watching what I ate somewhat and doing excessive amounts of Dance Dance Revolution and In The Groove). My weight settled around 220 lbs in Japan (which is noticeably overweight there), and around 260-270 here (which is noticeably overweight anywhere).

Anyway, I’ve been struggling to lose weight again, especially since I don’t have the freedom to do 3-5 2+ hour Dance Dance Revolution workouts a week like I used to. However, my weight has continued to creep up. I was around 260 at the beginning of this year, and was almost 268 until about a week ago.

As of this morning, I was 259.4. The second lowest weight I’ve clocked this year.