Skip to content

Instantly share code, notes, and snippets.

View djds23's full-sized avatar

Dean Silfen djds23

View GitHub Profile
@djds23
djds23 / gist:eeab5ba359b94a71dbb20f857fd04cfb
Created September 30, 2017 18:00 — forked from mobmad/gist:433ba54e9cb97d6d7771
Create self-signed certificate for wiremock and configure a java client under test for HTTPS

1. Generate self-signed certificate

keytool -genkey -alias wiremock -keyalg RSA -keysize 1024 \
    -validity 365 -keypass password -keystore identity.jks -storepass password

Important: keypass must equal storepass, or else you'll receive java.io.IOException: !JsseListener: java.security.UnrecoverableKeyException: Cannot recover key

2. Start wiremock with the new keystore and HTTPS enabled

@djds23
djds23 / LocalisedStrings.swift
Created February 28, 2018 00:30 — forked from douglashill/LocalisedStrings.swift
Generating an enum to ensure only defined localised string keys are used. For development on Apple platforms.
// Douglas Hill, February 2018
import Foundation
/// Returns a localised string with the key as an enum case so the compiler checks it exists.
/// The enum should be automatically generated using UpdateLocalisedStringKeys.swift.
public func localisedString(_ key: LocalisedStringKey) -> String {
return Bundle.main.localizedString(forKey: key.rawValue, value: nil, table: nil)
}