Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't make network calls from distributable build. #429

Closed
theapache64 opened this issue Feb 25, 2021 · 2 comments
Closed

Can't make network calls from distributable build. #429

theapache64 opened this issue Feb 25, 2021 · 2 comments

Comments

@theapache64
Copy link
Contributor

When I perform a network call from runDistributable build, am getting below exception. (run works though)

Stacktrace
12:39:12 AM: Executing task 'runDistributable'...

Starting Gradle Daemon...
Gradle Daemon started in 528 ms
> Task :compileKotlin UP-TO-DATE
> Task :compileJava NO-SOURCE
> Task :processResources NO-SOURCE
> Task :classes UP-TO-DATE
> Task :createRuntimeImage UP-TO-DATE
> Task :inspectClassesForKotlinIC UP-TO-DATE
> Task :jar UP-TO-DATE
> Task :createDistributable UP-TO-DATE

> Task :runDistributable
Exception in thread "AWT-EventQueue-0" javax.net.ssl.SSLHandshakeException: Remote host terminated the handshake
	at java.base/sun.security.ssl.SSLSocketImpl.handleEOF(Unknown Source)
	at java.base/sun.security.ssl.SSLSocketImpl.decode(Unknown Source)
	at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(Unknown Source)
	at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
	at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
	at okhttp3.internal.connection.RealConnection.connectTls(RealConnection.kt:379)
	at okhttp3.internal.connection.RealConnection.establishProtocol(RealConnection.kt:337)
	at okhttp3.internal.connection.RealConnection.connect(RealConnection.kt:209)
	at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.kt:226)
	at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.kt:106)
	at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.kt:74)
	at okhttp3.internal.connection.RealCall.initExchange$okhttp(RealCall.kt:255)
	at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:32)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
	at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
	at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
	at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
	at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
	at okhttp3.internal.connection.RealCall.execute(RealCall.kt:154)
	at MainKt.doNetworkCall(main.kt:36)
	at MainKt$main$1$1$1$1.invoke(main.kt:20)
	at MainKt$main$1$1$1$1.invoke(main.kt:16)
	at androidx.compose.foundation.ClickableKt$clickable$4$tap$1.invoke-k-4lQ0M(Clickable.kt:162)
	at androidx.compose.foundation.ClickableKt$clickable$4$tap$1.invoke(Clickable.kt:162)
	at androidx.compose.foundation.legacygestures.TapGestureFilter.onPointerEvent-H0pRuoY(TapGestureFilter.kt:119)
	at androidx.compose.ui.input.pointer.Node.dispatchToPointerInputFilter(HitPathTracker.kt:360)
	at androidx.compose.ui.input.pointer.Node.dispatchChanges(HitPathTracker.kt:308)
	at androidx.compose.ui.input.pointer.Node.dispatchChanges(HitPathTracker.kt:304)
	at androidx.compose.ui.input.pointer.Node.dispatchChanges(HitPathTracker.kt:304)
	at androidx.compose.ui.input.pointer.NodeParent.dispatchChanges(HitPathTracker.kt:179)
	at androidx.compose.ui.input.pointer.HitPathTracker.dispatchChanges(HitPathTracker.kt:111)
	at androidx.compose.ui.input.pointer.PointerInputEventProcessor.process-gBdvCQM(PointerInputEventProcessor.kt:80)
	at androidx.compose.ui.platform.DesktopOwner.processPointerInput$ui(DesktopOwner.desktop.kt:279)
	at androidx.compose.ui.platform.DesktopOwners.onMouseReleased(DesktopOwners.desktop.kt:138)
	at androidx.compose.desktop.ComposeLayer$initCanvas$2$mouseReleased$1.invoke(ComposeLayer.desktop.kt:159)
	at androidx.compose.desktop.ComposeLayer$initCanvas$2$mouseReleased$1.invoke(ComposeLayer.desktop.kt:158)
	at androidx.compose.desktop.AWTDebounceEventQueue$job$1.invokeSuspend(AWTDebounceEventQueue.desktop.kt:57)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)
	Suppressed: javax.net.ssl.SSLHandshakeException: Remote host terminated the handshake
		... 55 more
	Caused by: java.io.EOFException: SSL peer shut down incorrectly
		at java.base/sun.security.ssl.SSLSocketInputRecord.read(Unknown Source)
		at java.base/sun.security.ssl.SSLSocketInputRecord.readHeader(Unknown Source)
		at java.base/sun.security.ssl.SSLSocketInputRecord.decode(Unknown Source)
		at java.base/sun.security.ssl.SSLTransport.decode(Unknown Source)
		... 54 more
	Suppressed: javax.net.ssl.SSLHandshakeException: Remote host terminated the handshake
		... 55 more
	Caused by: java.io.EOFException: SSL peer shut down incorrectly
		at java.base/sun.security.ssl.SSLSocketInputRecord.read(Unknown Source)
		at java.base/sun.security.ssl.SSLSocketInputRecord.readHeader(Unknown Source)
		at java.base/sun.security.ssl.SSLSocketInputRecord.decode(Unknown Source)
		at java.base/sun.security.ssl.SSLTransport.decode(Unknown Source)
		... 54 more
	Suppressed: javax.net.ssl.SSLHandshakeException: Remote host terminated the handshake
		... 55 more
	Caused by: java.io.EOFException: SSL peer shut down incorrectly
		at java.base/sun.security.ssl.SSLSocketInputRecord.read(Unknown Source)
		at java.base/sun.security.ssl.SSLSocketInputRecord.readHeader(Unknown Source)
		at java.base/sun.security.ssl.SSLSocketInputRecord.decode(Unknown Source)
		at java.base/sun.security.ssl.SSLTransport.decode(Unknown Source)
		... 54 more
Caused by: java.io.EOFException: SSL peer shut down incorrectly
	at java.base/sun.security.ssl.SSLSocketInputRecord.read(Unknown Source)
	at java.base/sun.security.ssl.SSLSocketInputRecord.readHeader(Unknown Source)
	at java.base/sun.security.ssl.SSLSocketInputRecord.decode(Unknown Source)
	at java.base/sun.security.ssl.SSLTransport.decode(Unknown Source)
	... 54 more

Complete source code here

@AlexeyTsvetkov
Copy link
Collaborator

Seems like a duplicate of #269

@theapache64 can you try adding modules("jdk.crypto.ec") like this:

compose.desktop {
    application {
        mainClass = "MainKt"
        nativeDistributions {
            modules("jdk.crypto.ec")

            targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
            packageName = "untitled"
        }
    }
}

@theapache64
Copy link
Contributor Author

theapache64 commented Feb 26, 2021

Yup!! that worked. Thanks @AlexeyTsvetkov 👍 cc @jimgoog

AlexeyTsvetkov added a commit that referenced this issue Jul 19, 2021
Without this module most of https
is not going to work (see #269 or #429)

The inclusion of this module increases a size of
a prepackaged app by ~440 kb
and of a packaged dmg by ~167 kb
AlexeyTsvetkov added a commit that referenced this issue Jul 19, 2021
Without this module most of https
is not going to work (see #269 or #429)

The inclusion of this module increases a size of
a prepackaged app by ~440 kb
and of a packaged dmg by ~167 kb
mareklangiewicz pushed a commit to mareklangiewicz/compose-jb that referenced this issue Feb 14, 2022
Without this module most of https
is not going to work (see JetBrains#269 or JetBrains#429)

The inclusion of this module increases a size of
a prepackaged app by ~440 kb
and of a packaged dmg by ~167 kb
MatkovIvan pushed a commit to MatkovIvan/compose-multiplatform that referenced this issue May 10, 2023
* UIKit: Make rootView autoResize its subviews

This fixes the view size updates on screen rotation

* remove redundant imports

* add transition finish listener (JetBrains#429)

* add comments

---------

Co-authored-by: dima.avdeev <99798741+dima-avdeev-jb@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants