![]() |
[Update 2015-09-08: The key for the sslip.io domain has been revoked, which means that the service is no longer usable; however, the engineering behind sslip.io is still sound, and may be of interest to those who want to deploy a private version]sslip.io enables developers to equip their servers with valid SSL certificates for free (on the downside, the server's URI will be an awkward mash-up of the server's IP address and the sslip.io domain, e.g. https://52-0-56-137.sslip.io). Two components make this possible: a custom DNS (Domain Name System) backend that resolves hostnames to an embedded IP address (e.g. 192-168-0-1.sslip.io resolves to 192.168.0.1), and an SSL key and wildcard certificate downloadable from GitHub. This blog post discusses how we [1] implemented the former component (the custom DNS backend) (the latter component's implementation, a file downloaded from GitHub, is trivial and thus not discussed). sslip.io Implementation
Modifying xip.io to create sslip.ioxip.io's backend almost accomplished what we needed, but not quite: it lacked the ability to resolve hostnames that were in the sslip.io domain (i.e. not in an sslip.io subdomain). In fact, the typical sslip.io hostname did not resolve properly until it was 3 or more subdomains removed from the sslip.io domain. Here are some examples:
The hostname must be in the sslip.io domain for the wildcard certificate to work properly; it will not work in an sslip.io subdomain. This is a technical limitation of wildcard certs and the manner in which browsers treat them (read more here). Our solution: use dashes, not dots, to separate the numbers embedded in the hostname. Some examples:
We modified xip-pdns.sh, the core of the xip.io backend, to accommodate dashes as well as dots. Although we were surprised to discover that the xip.io backend program was a bash script, we found the coding to be tight, and making the needed changes was fairly straightforward:
We made the changes, which led us to the next step: deploying our changes with BOSH. Creating the BOSH releaseCreating the BOSH release posed no problems.
Rolling Your OwnRolling your own version of an xip.io-style nameserver is fairly straightforward; the xip BOSH release has instructions for setting up the Amazon AWS environment, deploying, and testing. Although there is work involved setting up the BOSH manifest (e.g. setting up the AWS VPC), it's not terribly burdensome. We encourage you to review the sample manifest. Most of it is boilerplate; search for "CHANGEME" to see what would need to be changed to deploy your own version. Surprisingly little. The Economics of sslip.io: $238.55 per yearCosts are a vital but often-overlooked dimension of smaller engineering projects. The sslip.io service costs $238.55 per year, two-thirds of which are paid to Amazon AWS for two [2] DNS nameservers that run 24 hours a day, answering queries for the sslip.io domain. In our case we were fortunate—the servers were already in place for a previous project, eliminating that line item (i.e. we only had to pay for the registration and certificates, not for the servers).
A Mysterious 1-Second Delay, UnmaskedIn one of the more curious moments of troubleshooting, we noticed a mysterious 1+ second delay in the
The fix was to force PowerDNS to bind to the IPv6 port by adding the following lineto the pdns.conf file: AcknowledgementsWe'd like to thank Pivotal Software for setting aside a Hack Day where we could implement sslip.io as a proof of concept. We'd like to thank Sam Stephenson for writing xip.io, which was the initial inspiration for sslip.io, and for suggesting the domain name sslip.io. Justin Smith consulted on the security implications of releasing an SSL certificate and key to the general public. Footnotes1 Tyler Schultz, Alvaro Perez-Shirley, and Brian Cunnie created sslip.io 2 We must have at least two name servers; we can't get away with just one. Per RFC 1034:
3 Amazon effectively charges $0.0086/hour for a 1 year term all-upfront t2.micro reserved instance. For those among you who worry that a t2.micro instance might be underpowered to serve DNS, fear not. If anything, our t2.micro instance is overpowered: We use
Our disk space is adequate, too, as measured by Note that our t2.micro instance is not exclusively dedicated to serving DNS; it's also running an NTP Pool server, processing ~1700 NTP queries / second. And running an nginx server. And yet, in spite of those extra processes, the server is essentially doing nothing 95% of the time. 4 The sharp-eyed reader may notice that ":0100" which appears in maria.nono.com's IPv6 address is not appropriately abbreviated (i.e. the leading "0" should be stripped). The reason the 0 isn't stripped is that when it is stripped, it becomes the emoji "100" ( |
