Git Product home page Git Product logo

mitmjavaproxy's Introduction

MITM Java Proxy

This Men-In-The-Middle Java Proxy is a derivative work that was originated from BrowserMob Proxy, then tailored first for the old Wilma versions, then reviewed and reworked again for the next generation of Wilma which is a proxy/stub/service virtualization tool and relies on this MitmJavaProxy.

Right now everything seems to be working so can be used.

Also please be aware that the main aim of creating this MITM Java Proxy is to support the proxy need of Wilma. Therefore none of the original browsermob-proxy features should be expected as working, on the other side, other features which was not in the original browsermob-proxy become available. Also, this version is prepered for Java 11 (and above) versions, and supports TSL. In sort, what you can do with it:

  • proxying the HTTP/HTTPS messages and
  • by intercepting both requests and responses
  • do whatever you want to do with the intercepted messages. It is possible to alter both the request before it hits the server (what is more - you can alter the target URL too) and the response before it arrives to the client.

Warning!

This proxy is a Men-In-The-Middle type of proxy that is able to capture ANY http traffic, everything that is transferred between the client and the server, even if it is encrypted. Use it carefully and only when you know what you do, and what you do is allowed/legal, and on environment where you are allowed/authorized to use the Proxy.

Embedded Mode

If you're using Java, the easiest way to get started is to embed the project directly. The jar is available in maven central repository.

Related gradle file should look like similar to the below:

repositories {
    mavenCentral()
}
    
dependencies {
    implementation('website.magyar:mitm-java-proxy:2.5.27.114')
}    

Release

Latest announced release is available here.

CI Build

Github CI Build status: CI

SonarCloud

Before building the proxy locally, create a gradle.properties file in root folder with the following content:

org.gradle.jvmargs=-Xmx2048m

Then use this command to start the build:

./gradlew clean build

To publish the library on local machine (in local maven repository):

./gradlew clean build publishToMavenLocal

To publish the library for public use (into public maven repository), you need the necessary right there and use this command:

./gradlew clean build publish -PbuildNumber=x

Please note that without specifying the build number, the build will be a SNAPSHOT build.

Detailed User's Guide

See detailed information of its usage at wiki pages.

HTTP Request Manipulation

Just add a Request Interceptor to the proxy server, and manipulate the request as you wish. See details here.

HTTP Response Manipulation

Just add a Response Interceptor to the proxy server, and you will get access to the responses.

The key to manipulate responses is the Response Volatility attribute. If a response is volatile, the proxy (or you) must work with the response a lot (call interceptor, extract, manipulate the response, compress, then release response towards the Client). This takes time. If a response is not volatile, then the proxy don't need to do such things. This of course a much faster method, so in case you don't need to manipulate the response, just leave responses as not volatile. Response volatility can be set in general via static method: ProxyServer.setResponseVolatility(boolean) Or can be set per request-response pair by using the Request Interceptors. See more details here.

SSL Support

While the proxy supports SSL, it requires that a Certificate Authority be installed in to the browser / at client from where you call a server via the proxy. This allows the client to trust all the SSL traffic coming from the proxy, which will be proxied using a classic man-in-the-middle technique.

IT IS CRITICAL THAT YOU DO NOT INSTALL THIS CERTIFICATE AUTHORITY ON A CLIENT/BROWSER THAT IS USED FOR ANYTHING OTHER THAN TESTING.

It is recommended to use -Djdk.tls.namedGroups="secp256r1, secp384r1, ffdhe2048, ffdhe3072" java arguments to address some issues still existing in some JDK implementations.

Please note that in V2.5.x the certificate used by this proxy is upgraded.

mitmjavaproxy's People

Contributors

hello-kunal avatar tkohegyi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

mitmjavaproxy's Issues

Random SSL issue - An established connection was aborted

It is not determined when and why, but sometimes SSLException happens when proxying a request on HTTPS channel:

javax.net.ssl.SSLException: An established connection was aborted by the software in your host machine
        at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:127)
        at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:324)
        at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:267)
        at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:262)
        at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:137)
        at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1460)
        at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1368)
        at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:437)
        at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:436)
        at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.upgrade(DefaultHttpClientConnectionOperator.java:191)
        at org.apache.http.impl.conn.BasicHttpClientConnectionManager.upgrade(BasicHttpClientConnectionManager.java:325)
        at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:428)
        at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
        at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
        at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
        at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
        at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
        at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:118)
        at org.rockhill.mitm.proxy.help.AbstractComplexProxyTool.httpGetWithApacheClient(AbstractComplexProxyTool.java:205)
        at org.rockhill.mitm.proxy.MitmComplexProxyWithExternalServerTest.testSimpleLocalGetRequestOverHTTPSThroughProxy(MitmComplexProxyWithExternalServerTest.java:42)

        Caused by:
        java.net.SocketException: An established connection was aborted by the software in your host machine
            at java.base/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:326)
            at java.base/sun.nio.ch.NioSocketImpl.read(NioSocketImpl.java:351)
            at java.base/sun.nio.ch.NioSocketImpl$1.read(NioSocketImpl.java:802)
            at java.base/java.net.Socket$SocketInputStream.read(Socket.java:937)
            at java.base/sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:450)
            at java.base/sun.security.ssl.SSLSocketInputRecord.decode(SSLSocketInputRecord.java:165)
            at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:108)
            ... 15 more

Would be nice to figure out why.

Random SSL issue - SSLException: Index out of bounds

We see random Proxy issue when doing HTTPS connection. Reason is unknown. Even the same code can produce this and can without issues next time. What we see is the following:

org.rockhill.mitm.proxy.request.RequestBodyManipulationTest > doubleBodySizeSecure FAILED
    javax.net.ssl.SSLException: arraycopy: last source index 32 out of bounds for byte[31]
        at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:133)
        at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:324)
        at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:267)
        at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:262)
        at java.base/sun.security.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1652)
        at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:443)
        at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:436)
        at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.upgrade(DefaultHttpClientConnectionOperator.java:191)
        at org.apache.http.impl.conn.BasicHttpClientConnectionManager.upgrade(BasicHttpClientConnectionManager.java:325)
        at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:428)
        at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
        at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
        at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
        at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
        at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
        at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:118)
        at org.rockhill.mitm.proxy.request.RequestBodyManipulationTest.doubleBodySizeSecure(RequestBodyManipulationTest.java:138)

        Caused by:
        java.lang.ArrayIndexOutOfBoundsException: arraycopy: last source index 32 out of bounds for byte[31]
            at java.base/java.lang.System.arraycopy(Native Method)
            at org.bouncycastle.crypto.params.X25519PublicKeyParameters.<init>(Unknown Source)
            at org.bouncycastle.jcajce.provider.asymmetric.edec.KeyAgreementSpi.engineDoPhase(KeyAgreementSpi.java:163)
            at java.base/javax.crypto.KeyAgreement.doPhase(KeyAgreement.java:579)
            at java.base/sun.security.ssl.KAKeyDerivation.t13DeriveKey(KAKeyDerivation.java:104)
            at java.base/sun.security.ssl.KAKeyDerivation.deriveKey(KAKeyDerivation.java:63)
            at java.base/sun.security.ssl.ServerHello$T13ServerHelloConsumer.consume(ServerHello.java:1290)
            at java.base/sun.security.ssl.ServerHello$ServerHelloConsumer.onServerHello(ServerHello.java:1005)
            at java.base/sun.security.ssl.ServerHello$ServerHelloConsumer.consume(ServerHello.java:893)
            at java.base/sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:396)
            at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:444)
            at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:422)
            at java.base/sun.security.ssl.TransportContext.dispatch(TransportContext.java:181)
            at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:164)
            at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1460)
            at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1368)
            at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:437)
            ... 11 more

Random SSL issue - SSLHandshakeException: Insufficient buffer remaining for AEAD cipher fragment (2).

There is another SSL issue - in Java implementation:

javax.net.ssl.SSLHandshakeException: Insufficient buffer remaining for AEAD cipher fragment (2). Needs to be more than tag size (16)
        at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:131)
        at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:349)
        at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:292)
        at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:287)
        at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:133)
        at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1408)
        at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1314)
        at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:440)
        at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:411)
        at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:436)
        at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.upgrade(DefaultHttpClientConnectionOperator.java:191)
        at org.apache.http.impl.conn.BasicHttpClientConnectionManager.upgrade(BasicHttpClientConnectionManager.java:325)
        at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:428)
        at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
        at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
        at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
        at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
        at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
        at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:118)
        at website.magyar.mitm.proxy.help.AbstractComplexProxyTool.httpGetWithApacheClient(AbstractComplexProxyTool.java:209)
        at website.magyar.mitm.proxy.MitmComplexProxyWithExternalServerTest.testSimpleRemoteGetRequestOverHTTPSThroughProxy(MitmComplexProxyWithExternalServerTest.java:79)

        Caused by:
        javax.crypto.BadPaddingException: Insufficient buffer remaining for AEAD cipher fragment (2). Needs to be more than tag size (16)
            at java.base/sun.security.ssl.SSLCipher$T13GcmReadCipherGenerator$GcmReadCipher.decrypt(SSLCipher.java:1868)
            at java.base/sun.security.ssl.SSLSocketInputRecord.decodeInputRecord(SSLSocketInputRecord.java:260)
            at java.base/sun.security.ssl.SSLSocketInputRecord.decode(SSLSocketInputRecord.java:181)
            at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:110)

How to run this proxy server on android platform... getting error of duplicate classess relate to logs while importing it using gradle dependency

Duplicate class org.apache.commons.logging.Log found in modules commons-logging-1.2 (commons-logging:commons-logging:1.2) and jcl-over-slf4j-2.0.6 (org.slf4j:jcl-over-slf4j:2.0.6)
Duplicate class org.apache.commons.logging.LogConfigurationException found in modules commons-logging-1.2 (commons-logging:commons-logging:1.2) and jcl-over-slf4j-2.0.6 (org.slf4j:jcl-over-slf4j:2.0.6)
Duplicate class org.apache.commons.logging.LogFactory found in modules commons-logging-1.2 (commons-logging:commons-logging:1.2) and jcl-over-slf4j-2.0.6 (org.slf4j:jcl-over-slf4j:2.0.6)
Duplicate class org.apache.commons.logging.impl.NoOpLog found in modules commons-logging-1.2 (commons-logging:commons-logging:1.2) and jcl-over-slf4j-2.0.6 (org.slf4j:jcl-over-slf4j:2.0.6)
Duplicate class org.apache.commons.logging.impl.SimpleLog found in modules commons-logging-1.2 (commons-logging:commons-logging:1.2) and jcl-over-slf4j-2.0.6 (org.slf4j:jcl-over-slf4j:2.0.6)

Random SSL Issue - SSL_NULL_WITH_NULL_NULL

Randomly popped up issue (same code, sometimes happening):

22:16:52.608 [SeleniumProxyHandler$SslRelay104-1] DEBUG n.l.b.p.h.TrustingSSLSocketFactory - Connecting socket to /127.0.0.1:59500 with timeout 0
22:16:52.608 [SeleniumProxyHandler$SslRelay104-1] DEBUG n.l.b.p.h.TrustingSSLSocketFactory - Enabled protocols: [TLSv1.3, TLSv1.2, TLSv1.1, TLSv1]
22:16:52.608 [SeleniumProxyHandler$SslRelay104-1] DEBUG n.l.b.p.h.TrustingSSLSocketFactory - Enabled cipher suites:[TLS_AES_256_GCM_SHA384, TLS_AES_128_GCM_SHA256, TLS_CHACHA20_POLY1305_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_RSA_WITH_AES_256_GCM_SHA384, TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256, TLS_DHE_DSS_WITH_AES_256_GCM_SHA384, TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_DSS_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_RSA_WITH_AES_256_CBC_SHA256, TLS_DHE_DSS_WITH_AES_256_CBC_SHA256, TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_DSS_WITH_AES_128_CBC_SHA256, TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_DSS_WITH_AES_256_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_256_GCM_SHA384, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_EMPTY_RENEGOTIATION_INFO_SCSV]
22:16:52.608 [SeleniumProxyHandler$SslRelay104-1] DEBUG n.l.b.p.h.TrustingSSLSocketFactory - Starting handshake
22:16:52.615 [SeleniumProxyHandler$SslRelay104-1] DEBUG n.l.b.p.h.TrustingSSLSocketFactory - Secure session established
22:16:52.615 [SeleniumProxyHandler$SslRelay104-1] DEBUG n.l.b.p.h.TrustingSSLSocketFactory -  negotiated protocol: NONE
22:16:52.615 [SeleniumProxyHandler$SslRelay104-1] DEBUG n.l.b.p.h.TrustingSSLSocketFactory -  negotiated cipher suite: SSL_NULL_WITH_NULL_NULL
22:16:52.615 [SeleniumProxyHandler$SslRelay104-1] DEBUG n.l.b.p.http.BrowserMobHttpClient$1 - Connection released: [id: 52][route: {s}->https://127.0.0.1:59500][total available: 0; route allocated: 0 of 6; total allocated: 0 of 30]
22:16:52.616 [SeleniumProxyHandler$SslRelay104-1] DEBUG n.l.b.p.http.BrowserMobHttpClient - EX @ call to server from proxy.

Would be nice to figure out why.

Could be in connection to: https://stackoverflow.com/questions/18080996/ssl-null-with-null-null-cipher-suite-in-in-jetty-logs
where the solution was:

Long story: when created, the SslConnection extracts the initial SSLSession object 
from the SSLEngine and keeps logging with it. 
Initial SSLSession has a SSL_NULL_WITH_NULL_NULL cipher 
and that's normal because SSL handshake hasn't happened yet. 
Activating -Djavax.net.debug=all shows that handshake really occurs, 
and interactive debugging shows that SSLEngine upgrades 
to an SSLSession with a real cipher. The problem is just Jetty's 
SslConnection that still logs with initial SSLSession object. 
(It also uses values from initial SSLSession to allocate buffers but that's another problem.)

Patching SslConnection for logging with _engine.getSession() gives expected result.

Build and Certificate error

Build Error

  • Platform : windows 10
  • Java Version : Oracle Java 11 and OpenJDK19

I used oracle java 11 and openJDK19 in my testing.
When Using this version of proxy:
implementation group: 'website.magyar', name: 'mitm-java-proxy', version: '2.5.26.113'
importing the ProxyServer class, gives this error :

import website.magyar.mitm.proxy.ProxyServer;
                                ^

bad class file: .../website/magyar/mitm/proxy/ProxyServer.class
    class file has wrong version 59.0, should be 55.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.

implementation 'website.magyar:mitm-java-proxy:2.0.23.105' works with java 11 without any problem.

Certificate Error

Because of the build error described above, I am using version 2.0.23.105 from maven repo. This version work fine with Oracle java 11.
I Copied blank_crl.dec, blank_crl.pem, and cybervillainsCA.cer from the website.magyar:mitm-java-proxy:2.0.23.105.jar to my desktop and imported cybervilliansCA.cer to my Firefox trusted store. But it is not working as expected when I'm browsing a site with HTTPS. It shows cert not trusted and some other cert related bla bla bla.
I also tried to use curl for testing but it also give same problem. After executing this command :
curl.exe -X POST "https://eu.httpbin.org/post" -H "accept: application/json" -d "param1=value1&param2=value2" -x http://127.0.0.1:8080 --cacert .\blank_crl.pem
I get this error : curl: (60) schannel: CertGetCertificateChain trust error CERT_TRUST_IS_PARTIAL_CHAIN
I also used the extra cli parameters -Djdk.tls.namedGroups="secp256r1, secp384r1, ffdhe2048, ffdhe3072" as recommended for avoiding SSL related issues in my run configuration but it also doesn't working.

What I want

I want to import the CAcert into my browser and the proxy should log all the requests and responses my browser is making/receiving

HTTPS call causes E500, if cannot resolve DNS record

Internal error (E500) occurs in proxy if DNS record cannot be resolved during a HTTPS call.

Answer (incorrect):
14:05:09.380 [SocketListener0-1] DEBUG n.l.b.p.s.SeleniumProxyHandler - CONNECT: .....
14:05:09.418 [SocketListener0-1] DEBUG n.l.b.p.s.SeleniumProxyHandler - error during handleConnect
java.net.UnknownHostException: No such host is known (....)
14:05:09.422 [SocketListener0-1] DEBUG n.l.b.p.jetty.http.HttpConnection - RESPONSE:
HTTP/1.1 500 java%2Enet%2EUnknownHostException%3A+No+such+host+is+known+.....

In case of HTTP, E404 is used (let say it is correct):
14:03:58.604 [SocketListener0-1] DEBUG n.l.b.p.jetty.http.HttpConnection - RESPONSE:
HTTP/1.1 404 Not Found

quickest test command (if proxy is running on localhost and at port 9092):
curl --insecure -X GET https://no.dns.record -x 127.0.0.1:9092
result: curl: (56) CONNECT tunnel failed, response 500

Random SSL issue - at net.lightbody.bmp.proxy.jetty.util.LineInput.fill(LineInput.java:417)

This issue happens randomly, same code can run and fail later...

20:43:58.518 [SocketListener90-1] DEBUG n.l.b.p.jetty.http.HttpConnection - Normal handling issue
java.net.SocketException: Connection reset
	at java.base/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:324) ~[na:na]
	at java.base/sun.nio.ch.NioSocketImpl.read(NioSocketImpl.java:351) ~[na:na]
	at java.base/sun.nio.ch.NioSocketImpl$1.read(NioSocketImpl.java:802) ~[na:na]
	at java.base/java.net.Socket$SocketInputStream.read(Socket.java:937) ~[na:na]
	at net.lightbody.bmp.proxy.jetty.util.LineInput.fill(LineInput.java:417) ~[main/:na]
	at net.lightbody.bmp.proxy.jetty.util.LineInput.fillLine(LineInput.java:482) ~[main/:na]
	at net.lightbody.bmp.proxy.jetty.util.LineInput.readLineBuffer(LineInput.java:273) ~[main/:na]
	at net.lightbody.bmp.proxy.jetty.util.LineInput.readLineBuffer(LineInput.java:259) ~[main/:na]
	at net.lightbody.bmp.proxy.jetty.http.HttpRequest.readHeader(HttpRequest.java:226) ~[main/:na]
	at net.lightbody.bmp.proxy.jetty.http.HttpConnection.readRequest(HttpConnection.java:764) ~[main/:na]
	at net.lightbody.bmp.proxy.jetty.http.HttpConnection.handleNext(HttpConnection.java:803) ~[main/:na]
	at net.lightbody.bmp.proxy.jetty.http.HttpConnection.handle(HttpConnection.java:744) ~[main/:na]
	at net.lightbody.bmp.proxy.jetty.http.SocketListener.handleConnection(SocketListener.java:183) ~[main/:na]
	at net.lightbody.bmp.proxy.jetty.util.ThreadedServer.handle(ThreadedServer.java:243) ~[main/:na]
	at net.lightbody.bmp.proxy.jetty.util.ThreadPool$PoolThread.run(ThreadPool.java:365) ~[main/:na]

HTTPS call cause E500 - SEC_E_INTERNAL_ERROR (0x80090304)

For an unknow reason, in some nev we see this issue:
curl --ssl-no-revoke --insecure -X POST https://blllllh.com -x 127.0.0.1:9092 -v --proxy-insecure

and the error is:
... CONNECT phase completed

  • CONNECT tunnel established, response 200
  • schannel: disabled automatic use of client certificate
  • ALPN: curl offers http/1.1
  • schannel: next InitializeSecurityContext failed: SEC_E_INTERNAL_ERROR (0x80090304) - The Local Security Authority cannot be contacted

The reason is unknown. However it might have connected to this: https://learn.microsoft.com/en-us/answers/questions/717219/https-client-and-server-app-results-in-sec-e-inter

Issue occurs when using Postman too, but with other message:
Error: write EPROTO 52238216:error:10000070:SSL routines:OPENSSL_internal:BAD_PACKET_LENGTH:../../../../src/third_party/boringssl/src/ssl/ssl_aead_ctx.cc:257: 52238216:error:1000008b:SSL routines:OPENSSL_internal:DECRYPTION_FAILED_OR_BAD_RECORD_MAC:../../../../src/third_party/boringssl/src/ssl/tls_record.cc:298:

Seems the target HTTPS server has some issues.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.