Skip to content

Instantly share code, notes, and snippets.

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

### Keybase proof
I hereby claim:
* I am zafar-saleem on github.
* I am zafarsaleem (https://keybase.io/zafarsaleem) on keybase.
* I have a public key whose fingerprint is 5222 8CC9 4A13 8857 CF4D EE14 12E5 A246 73AA 68CC
To claim this, I am signing this object:
export class TimeRangeUtil {
getTimeRange(response) {
let startHours: any = new Date(response[0].startTime).getHours();
let startMinutes: any = new Date(response[0].startTime).getMinutes();
let startDayPart: any = startHours >= 12 ? 'pm' : 'am';
let endHours: any = new Date(response[0].endTime).getHours();
let endMinutes: any = new Date(response[0].endTime).getMinutes();
let endDayPart: any = endHours >= 12 ? 'pm' : 'am';
class Todo {
constructor() {
}
}
export default Todo;
import Todo from './scripts/Todo';
let todo = new Todo();
<div class="edit-popup">
<input type="text" name="" class="edit-item">
<button class="btn-update">Update</button>
</div>
<div class="container">
<div class="sections">
<input type="text" name="" class="item">
<button class="btn-add-item">Add</button>
<ul>
<li><a href="#">All</a></li>
class Todo {
constructor() {
this.list = document.querySelector('.list-items');
this.render();
}
}
export default Todo;
let mockData = [{
id: '1',
title: 'This is title',
done: false,
date: new Date()
}, {
id: '2',
title: 'This is second title',
done: false,
date: new Date()
class Todo {
constructor() {
this.list = document.querySelector('.list-items');
this.render();
}
// render function
render() {
this.list.innerHTML = '';
class Todo {
constructor() {
this.list = document.querySelector('.list-items');
this.render();
}
render() {
this.list.innerHTML = '';
mockData.forEach(item => {