org.bouncycastle.jsse.provider.ImpersonateSSLEngine Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of impersonator Show documentation
Show all versions of impersonator Show documentation
Spoof TLS/JA3/JA4 and HTTP/2 fingerprints in Java
The newest version!
package org.bouncycastle.jsse.provider;
import com.github.zhkl0228.impersonator.Impersonator;
import org.bouncycastle.tls.TlsClientProtocol;
class ImpersonateSSLEngine extends ProvSSLEngine {
private final Impersonator impersonator;
ImpersonateSSLEngine(ContextData contextData, String peerHost, int peerPort, Impersonator impersonator) {
super(contextData, peerHost, peerPort);
this.impersonator = impersonator;
}
@Override
protected TlsClientProtocol newTlsClientProtocol() {
return new ImpersonateTlsClientProtocol(impersonator);
}
@Override
protected ProvTlsClient newProvTlsClient(ProvSSLParameters sslParameters) {
int[] cipherSuites = impersonator.getCipherSuites();
ImpersonateSSLSocketWrap.checkCipherSuites(contextData, cipherSuites);
return new ImpersonateTlsClient(this, sslParameters, cipherSuites);
}
}