Skip to content

Instantly share code, notes, and snippets.

SSL over :80 with nginx

Using nginx's error_page directive we can support SSL over both :80 and :443

Why?

Some intrusive firewalls, ISPs, companies, and ``Anti-virus'' programs attempt to intercept SSL connections on :443. Some of these programs even offer their own certificate, in order to perform MiTM attacks. In more extreme cases, connections may be entirely blocked on :443.

By allowing SSL connections on :80, users with these threats may still access the server securely.

How?

Using nginx's

#!/bin/sh
## Load std
. 'lib-std.sh'
transfer_accountlist() {}
transfer_homedir() {}
transfer_wpdb() {}
transfer_account() {}
@Syrup-tan
Syrup-tan / oh god why.js
Created October 18, 2015 22:11
ENTERPRISE QUALITY STRING REVERSER
w = reverse('SebaJun');
while (v = w.next().value) console.log(v);
function *reverse(s) {
yield s;
for (i = 0, j = 0; j++ < s.length; i = 0) while (s[i+1] && i + j < s.length) {
yield s = [
s.slice(0, i),
s.slice(i+1, i+2),
s.slice(i, i+1),
s.slice(i+2),
@Syrup-tan
Syrup-tan / _readme.md
Last active February 15, 2016 22:48
simple acme-tiny sh wrapper

Shell script to generate ssl certificates signed from letsencrypt.

demo

Requires diafygi/acme-tiny.

Requires a web-server with a configured /.well-known/acme-challenge/ set to CHALLENGE_PATH in the third line of the script. See Step 3 of diafygi's great readme

TODO:

  • configurable ./account.key (i.e. not hardcoded)