Skip to content

Instantly share code, notes, and snippets.

[1]. http://googletesting.blogspot.co.uk/2015/04/just-say-no-to-more-end-to-end-tests.html
[2]. http://misko.hevery.com/2008/07/30/top-10-things-which-make-your-code-hard-to-test/
[3]. http://googletesting.blogspot.com/2008/08/by-miko-hevery-so-you-decided-to.html
[4]. https://drive.google.com/a/wso2.com/file/d/0B7G7aijG9EvMVU40bHZ5bEV4MTg/view?usp=sharing
[5]. https://www.youtube.com/watch?v=XcT4yYu_TTs
# export a public certificate
keytool -export -alias wso2carbon -file key.crt -keystore wso2carbon.jks
or
keytool -export -keystore pathToKeystore -rfc -alias aliasNameForCertificate
#print out the certificate
openssl x509 -text -inform DER -in key.crt
or
keytool -printcert -rfc -file pathToCertificate
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_PORT => "9443",
CURLOPT_URL => "https://localhost:9443/oauth2/token",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
<?xml version="1.0" encoding="UTF-8"?>
<EntityDescriptor
xmlns="urn:oasis:names:tc:SAML:2.0:metadata" entityID="localhost">
<RoleDescriptor
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol"
xsi:type="IDPSSODescriptorType">
<KeyDescriptor use="signing">
<KeyInfo
xmlns="http://www.w3.org/2000/09/xmldsig#">
@mefarazath
mefarazath / GagSsl.java
Last active June 1, 2022 16:07 — forked from chalup/GagSsl.java
Get OkHttpClient which ignores all SSL errors.
private static OkHttpClient getUnsafeOkHttpClient() {
try {
// Create a trust manager that does not validate certificate chains
final TrustManager[] trustAllCerts = new TrustManager[]{
new X509TrustManager() {
@Override
public void checkClientTrusted(java.security.cert.X509Certificate[] chain,
String authType) throws CertificateException {
}
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
<ServiceProvider>
<ApplicationID>3</ApplicationID>
<ApplicationName>travelocity.com</ApplicationName>
<Description>travelocity Service Provider</Description>
<IsSaaSApp>false</IsSaaSApp>
<InboundAuthenticationConfig>
<InboundAuthenticationRequestConfigs>
<InboundAuthenticationRequestConfig>
<InboundAuthKey>travelocity.com</InboundAuthKey>
<InboundAuthType>samlsso</InboundAuthType>
/*
* Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
[2017-03-09 22:57:58,419] ERROR {org.wso2.carbon.identity.application.authentication.framework.store.SessionDataStore} - Error while storing session data
java.io.NotSerializableException: org.apache.tomcat.util.net.jsse.JSSESupport
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
at java.util.HashMap.internalWriteEntries(HashMap.java:1785)
at java.util.HashMap.writeObject(HashMap.java:1362)
at sun.reflect.GeneratedMethodAccessor87.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1028)