Backport openssl patches

Closes #429.

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
Merge branch 'stable'