This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.security._ | |
import java.net.URL | |
import javax.net.ssl.{KeyManagerFactory, TrustManagerFactory} | |
import org.apache.http.conn.ssl.SSLSocketFactory | |
import org.apache.http.conn.scheme.Scheme | |
import dispatch._ | |
// Gist trait for doing SSL with mutual certificate exchange using dispatch. | |
// This works without having to set up global JDK-wide keystore and truststore files. | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait Publishable { | |
def asWebMarkup: String | |
} | |
case class BlogPost(title: String, text: String) extends Publishable { | |
def asWebMarkup = | |
"""|<h2>%s</h2> | |
|<div>%s</div>""".stripMargin format(title, text) | |
} |