JetpackDuba / Gitnuro

A FOSS Git multiplatform client for newbies and pros

Home Page:https://gitnuro.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

disable SSL certification at once time

lingfengyu-dreaming opened this issue · comments

Is your feature request related to a problem? Please describe.
I found I always meet SSL error these days, and i should open git bash to push and pull with env GIT_SSL_NO_VERIFY=true everytime. So i think if there can have a button to toggle up temporary ban SSL certification?

Describe the solution you'd like
Add a button or something else that can select some settings like disable SSL.

Describe alternatives you've considered
Git Bash

Additional context
none

i click enter accidently, so there's something edited

for example, the commands in git bash look like:

env GIT_SSL_NO_VERIFY=true git push origin
env GIT_SSL_NO_VERIFY=true git pull
env GIT_SSL_NO_VERIFY=true git fetch

Hey! Thanks for your report, I'll look into it to check what are the options.

I'm not really sure how I'll test it though. This may be more problematic than adding the option to disable SSL.

Thank you. It's not necessary to add if jGit can't do it. I just think if there can have a place to choose some special options, like disable SSL when pull or push, change file encode when save file when partly stage or something else. Actually I can do most of those by git bash, so I think it just a choseable enhancement.
About how to test.... I think it might not be use frequently by most user, even never use it, maybe it can be release as a beta function and not promise it can be used in all cases. Maybe this applies to other features as well?

Do you use Linux? To try to build a beta version with the option to disable SSL so you can test it.

Normal windows is fine too. I'll let you know in a few days them.

Ok, I will wait until Windows version release.

Here goes a test version https://we.tl/t-j2kOKljfoE

The link will expire in 1 week. Check Settings -> Security -> Check "Do not verify SSL security".

I haven't tested it because I haven't got access to a server with such case. If it doesn't work, please start the app from the CLI and attach the logs.

downloaded. I will try it in some days. Thank you.

Sorry, there still problems. I test it and it doesn't work. How to start it from CLI?

Actually I think you can get the logs from %LOCALAPPDATA%\Gitnuro\logs. You may want to filter private stuff before posting it (if required).

logs here:

2023-11-23 00:48:00 INFO  slf4j:8 - SharedRepositoryStateMa - Refreshing repository state com.jetpackduba.gitnuro.git.rebase.RebaseInteractiveState$None@5a8a8b90
2023-11-23 00:48:06 INFO  slf4j:8 - HttpCredentialsProvider - Items are [InformationalMessage - A secure connection to https://github.com/lingfengyu-dreaming/Cliff-Dark.git could not be established because the server's certificate could not be validated.
SSL reported: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Do you want to skip SSL verification for this server?, YesNoType - Skip SSL verification for this single git operation, YesNoType - Skip SSL verification for git operations for repository *\Cliff-Dark\.git, YesNoType - Always skip SSL verification for this server from now on]
2023-11-23 00:48:06 ERROR slf4j:16 - FetchAllBranchesUseCase - Fetch failed for remote origin with error https://github.com/lingfengyu-dreaming/Cliff-Dark.git: Secure connection to https://github.com/lingfengyu-dreaming/Cliff-Dark.git could not be established because of SSL problems
org.eclipse.jgit.api.errors.TransportException: https://github.com/lingfengyu-dreaming/Cliff-Dark.git: Secure connection to https://github.com/lingfengyu-dreaming/Cliff-Dark.git could not be established because of SSL problems
	at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:249)
	at com.jetpackduba.gitnuro.git.remote_operations.FetchAllBranchesUseCase$invoke$2$1.invokeSuspend(FetchAllBranchesUseCase.kt:46)
	at com.jetpackduba.gitnuro.git.remote_operations.FetchAllBranchesUseCase$invoke$2$1.invoke(FetchAllBranchesUseCase.kt)
	at com.jetpackduba.gitnuro.git.remote_operations.FetchAllBranchesUseCase$invoke$2$1.invoke(FetchAllBranchesUseCase.kt)
	at com.jetpackduba.gitnuro.git.remote_operations.HandleTransportUseCase.invoke(HandleTransportUseCase.kt:40)
	at com.jetpackduba.gitnuro.git.remote_operations.FetchAllBranchesUseCase$invoke$2.invokeSuspend(FetchAllBranchesUseCase.kt:26)
	at com.jetpackduba.gitnuro.git.remote_operations.FetchAllBranchesUseCase$invoke$2.invoke(FetchAllBranchesUseCase.kt)
	at com.jetpackduba.gitnuro.git.remote_operations.FetchAllBranchesUseCase$invoke$2.invoke(FetchAllBranchesUseCase.kt)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:78)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:167)
	at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
	at com.jetpackduba.gitnuro.git.remote_operations.FetchAllBranchesUseCase.invoke(FetchAllBranchesUseCase.kt:21)
	at com.jetpackduba.gitnuro.viewmodels.MenuViewModel$fetchAll$1.invokeSuspend(MenuViewModel.kt:45)
	at com.jetpackduba.gitnuro.viewmodels.MenuViewModel$fetchAll$1.invoke(MenuViewModel.kt)
	at com.jetpackduba.gitnuro.viewmodels.MenuViewModel$fetchAll$1.invoke(MenuViewModel.kt)
	at com.jetpackduba.gitnuro.git.TabState$safeProcessing$job$1$2.invokeSuspend(TabState.kt:137)
	at com.jetpackduba.gitnuro.git.TabState$safeProcessing$job$1$2.invoke(TabState.kt)
	at com.jetpackduba.gitnuro.git.TabState$safeProcessing$job$1$2.invoke(TabState.kt)
	at com.jetpackduba.gitnuro.extensions.StateManagementUtilsKt.delayedStateChange(StateManagementUtils.kt:21)
	at com.jetpackduba.gitnuro.git.TabState$safeProcessing$job$1.invokeSuspend(TabState.kt:125)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
	at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:103)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
Caused by: org.eclipse.jgit.errors.TransportException: https://github.com/lingfengyu-dreaming/Cliff-Dark.git: Secure connection to https://github.com/lingfengyu-dreaming/Cliff-Dark.git could not be established because of SSL problems
	at org.eclipse.jgit.transport.TransportHttp.handleSslFailure(TransportHttp.java:842)
	at org.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:743)
	at org.eclipse.jgit.transport.TransportHttp.openFetch(TransportHttp.java:467)
	at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:153)
	at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:105)
	at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1465)
	at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:238)
	... 27 more
Caused by: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at java.base/sun.security.ssl.Alert.createSSLException(Unknown Source)
	at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source)
	at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source)
	at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source)
	at java.base/sun.security.ssl.CertificateMessage$T13CertificateConsumer.checkServerCerts(Unknown Source)
	at java.base/sun.security.ssl.CertificateMessage$T13CertificateConsumer.onConsumeCertificate(Unknown Source)
	at java.base/sun.security.ssl.CertificateMessage$T13CertificateConsumer.consume(Unknown Source)
	at java.base/sun.security.ssl.SSLHandshake.consume(Unknown Source)
	at java.base/sun.security.ssl.HandshakeContext.dispatch(Unknown Source)
	at java.base/sun.security.ssl.HandshakeContext.dispatch(Unknown Source)
	at java.base/sun.security.ssl.TransportContext.dispatch(Unknown Source)
	at java.base/sun.security.ssl.SSLTransport.decode(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 java.base/sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
	at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
	at java.base/java.net.HttpURLConnection.getResponseCode(Unknown Source)
	at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(Unknown Source)
	at org.eclipse.jgit.transport.http.JDKHttpConnection.getResponseCode(JDKHttpConnection.java:88)
	at org.eclipse.jgit.util.HttpSupport.response(HttpSupport.java:232)
	at org.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:665)
	... 32 more
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at java.base/sun.security.validator.PKIXValidator.doBuild(Unknown Source)
	at java.base/sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
	at java.base/sun.security.validator.Validator.validate(Unknown Source)
	at java.base/sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source)
	at java.base/sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
	... 53 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at java.base/sun.security.provider.certpath.SunCertPathBuilder.build(Unknown Source)
	at java.base/sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source)
	at java.base/java.security.cert.CertPathBuilder.build(Unknown Source)
	... 58 more
2023-11-23 00:48:06 ERROR slf4j:16 - TabState - Fetch failed for remote origin: https://github.com/lingfengyu-dreaming/Cliff-Dark.git: Secure connection to https://github.com/lingfengyu-dreaming/Cliff-Dark.git could not be established because of SSL problems
com.jetpackduba.gitnuro.exceptions.FetchException: Fetch failed for remote origin: https://github.com/lingfengyu-dreaming/Cliff-Dark.git: Secure connection to https://github.com/lingfengyu-dreaming/Cliff-Dark.git could not be established because of SSL problems
	at com.jetpackduba.gitnuro.git.remote_operations.FetchAllBranchesUseCase$invoke$2.invokeSuspend(FetchAllBranchesUseCase.kt:62)
	at com.jetpackduba.gitnuro.git.remote_operations.FetchAllBranchesUseCase$invoke$2.invoke(FetchAllBranchesUseCase.kt)
	at com.jetpackduba.gitnuro.git.remote_operations.FetchAllBranchesUseCase$invoke$2.invoke(FetchAllBranchesUseCase.kt)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:78)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:167)
	at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
	at com.jetpackduba.gitnuro.git.remote_operations.FetchAllBranchesUseCase.invoke(FetchAllBranchesUseCase.kt:21)
	at com.jetpackduba.gitnuro.viewmodels.MenuViewModel$fetchAll$1.invokeSuspend(MenuViewModel.kt:45)
	at com.jetpackduba.gitnuro.viewmodels.MenuViewModel$fetchAll$1.invoke(MenuViewModel.kt)
	at com.jetpackduba.gitnuro.viewmodels.MenuViewModel$fetchAll$1.invoke(MenuViewModel.kt)
	at com.jetpackduba.gitnuro.git.TabState$safeProcessing$job$1$2.invokeSuspend(TabState.kt:137)
	at com.jetpackduba.gitnuro.git.TabState$safeProcessing$job$1$2.invoke(TabState.kt)
	at com.jetpackduba.gitnuro.git.TabState$safeProcessing$job$1$2.invoke(TabState.kt)
	at com.jetpackduba.gitnuro.extensions.StateManagementUtilsKt.delayedStateChange(StateManagementUtils.kt:21)
	at com.jetpackduba.gitnuro.git.TabState$safeProcessing$job$1.invokeSuspend(TabState.kt:125)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
	at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:103)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)

Sorry for the late response, I've been a bit absent recently. I've fixed a couple of issues I've noticed from the logs, here is a new version: https://we.tl/t-6ACejm2vQp

Tested. I think it is finished, because I hadn't seen errors except connection failed this time(This is because network environment). I think the function maybe finished but not totally confirmed. Thank you!

Fantastic! I may do some UI improvements but not much more for now. Thanks for your feedback.