org.littleshoot.proxy.mitm.Authority Java Examples

The following examples show how to use org.littleshoot.proxy.mitm.Authority. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MITMUtility.java    From PowerTunnel with MIT License 5 votes vote down vote up
public static CertificateSniffingMitmManager mitmManager() throws RootCertificateException, IOException {
    char[] password;
    List<String> values = PowerTunnel.SETTINGS.filteredLoad(new DataStore.Filter() {
        @Override
        public boolean accept(String line) {
            return line.startsWith(Settings.ROOT_CA_PASSWORD);
        }
    });
    if(values != null) {
        password = values.get(0).split(Settings.KEY_VALUE_SEPARATOR)[1].toCharArray();
    } else {
        password = UUID.randomUUID().toString().toCharArray();
        PowerTunnel.SETTINGS.setOption(Settings.ROOT_CA_PASSWORD, new String(password));
        PowerTunnel.SETTINGS.save();
        //PowerTunnel.SETTINGS.unload(Settings.ROOT_CA_PASSWORD);
    }
    try {
        return new CertificateSniffingMitmManager(new Authority(new File("."),
                "powertunnel-root-ca", password,
                "PowerTunnel Root CA",
                "PowerTunnel",
                "PowerTunnel",
                "PowerTunnel",
                "PowerTunnel"));
    } finally {
        password = null;
    }
}
 
Example #2
Source File: TrustedServer.java    From LittleProxy-mitm with Apache License 2.0 5 votes vote down vote up
public Server start() throws Exception {
    BouncyCastleSslEngineSource es = new BouncyCastleSslEngineSource(
            new Authority(), true, true);
    SubjectAlternativeNameHolder san = new SubjectAlternativeNameHolder();
    // san.addDomainName("localhost");
    es.initializeServerCertificates(commonName, san);
    File certChainFile = new File("littleproxy-mitm-" + commonName
            + "-cert.pem");
    File keyFile = new File("littleproxy-mitm-" + commonName + "-key.pem");
    return initServerContext(certChainFile, keyFile);
}
 
Example #3
Source File: BrowserMobProxyServer.java    From CapturePacket with MIT License 4 votes vote down vote up
public String getCerPath(){
    return mKeyStoreDir + File.separator + Authority.CER_ALIAS + Authority.CER_FILE_EXTENSION;
}