Skip to content

Instantly share code, notes, and snippets.

@zukka77
zukka77 / cognomi.txt
Last active November 19, 2015 22:44 — forked from pdesterlich/cognomi.txt
lista cognomi italiani
Agostini
Aiello
Albanese
Amato
Antonelli
Arena
Baldi
Barbieri
Barone
Basile
@zukka77
zukka77 / CompositeX509KeyManager.java
Created December 19, 2015 01:50 — forked from codyaray/CompositeX509KeyManager.java
A composite KeyManager for doing SSL in Java with multiple keystores. See http://codyaray.com/2013/04/java-ssl-with-multiple-keystores
package com.mycompany.ssl;
import java.net.Socket;
import java.security.Principal;
import java.security.PrivateKey;
import java.security.cert.X509Certificate;
import java.util.List;
import javax.annotation.Nullable;
import javax.net.ssl.X509KeyManager;
@zukka77
zukka77 / UnsafeOkHttpClient.java
Last active January 10, 2016 17:23
Unsafe OkHttpClient
private static OkHttpClient getUnsafeOkHttpClient() throws KeyManagementException, NoSuchAlgorithmException {
// 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) {
}
@Override
@zukka77
zukka77 / CustomSSLSocketFactory.java
Created January 10, 2016 17:29
Custom SSLSocketFactory
import java.io.FileNotFoundException;
import java.io.IOException;
import java.security.KeyManagementException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.security.UnrecoverableKeyException;
import java.security.cert.CertificateException;
package com.mycompany.ssl;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.List;
import javax.net.ssl.X509TrustManager;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
@zukka77
zukka77 / KeyLengthDetector.java
Created February 25, 2016 20:06 — forked from jehrhardt/KeyLengthDetector.java
Detect the allowed size of AES keys on the JVM. If the size is <= 256, it is limited. To fix it JCE unlimted stregth files are needed.
import javax.crypto.Cipher;
import java.security.NoSuchAlgorithmException;
public class KeyLengthDetector {
public static void main(String[] args) {
int allowedKeyLength = 0;
try {
allowedKeyLength = Cipher.getMaxAllowedKeyLength("AES");
} catch (NoSuchAlgorithmException e) {
@zukka77
zukka77 / nomi_italiani.txt
Created November 19, 2015 22:38 — forked from pdesterlich/nomi_italiani.txt
lista nomi italiani
abaco
abbondanza
abbondanzia
abbondanzio
abbondazio
abbondia
abbondina
abbondio
abdenago
abdon
port=9999
proxy=myproxy
proxy_port=8080
dest=myserver
dest_port=443
ssh -D $port user@$dest -o "ProxyCommand corkscrew $proxy $proxy_port $dest $dest_port proxy.auth"
SSLProtocol all -SSLv2 -SSLv3
SSLHonorCipherOrder on
SSLCipherSuite ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS
# HTTP Strict Transport Security
Header always set Strict-Transport-Security "max-age=63072000; includeSubDomains"
RewriteEngine On
RewriteCond %{HTTP:Upgrade} =websocket
RewriteRule /(.*) ws://localhost:9001/api/$1 [P,L]
RewriteCond %{HTTP:Upgrade} !=websocket
RewriteRule /(.*) http://localhost:9001/api/$1 [P,L]