Conversation
…evonfw#1751-create-go-commandlet
…changable password for the custom truststore
…evonfw#1552-add-certificates-to-truststore
Pull Request Test Coverage Report for Build 23899438687Details
💛 - Coveralls |
cli/src/main/java/com/devonfw/tools/ide/commandlet/TruststoreCommandlet.java
Outdated
Show resolved
Hide resolved
| return false; | ||
| } | ||
| String normalized = text.toLowerCase(Locale.ROOT); | ||
| return normalized.contains(ERROR_TEXT_PKIX) || normalized.contains(ERROR_TEXT_CERT_PATH) || normalized.contains(ERROR_TEXT_SSL_HANDSHAKE); |
There was a problem hiding this comment.
A TLS/SSL handshake exception is something completely different and should not be handled in the same way.
In such case we do not have a self-signed certificate and our workaround will not help in any way.
I am also not fully convinced that unable to find valid certification path is always indicating our problem we are trying to fix but at least this is very slightly related.
There was a problem hiding this comment.
I removed the TLS handshake and unable to find valid certification path from the check. But i added "unable to get local issuer certificate" because this should be related to our problem and that message occurs when trying to install plugins for vscode:
Installing extensions... Installing extension 'esbenp.prettier-vscode'... Error while installing extension esbenp.prettier-vscode: unable to get local issuer certificate Failed Installing Extensions: esbenp.prettier-vscode
There was a problem hiding this comment.
But the VSCode issue cannot be fixed by properly configuring the truststore for IDEasy.
VSCode is a separate tool run as an isolated process so it cannot know about our IDEasy truststore.
For me this still does not make sense.
cli/src/main/java/com/devonfw/tools/ide/truststore/TruststoreUtilImpl.java
Outdated
Show resolved
Hide resolved
|
|
||
| public static final char[] DEFAULT_CACERTS_PASSWORD = "changeit".toCharArray(); | ||
|
|
||
| public static final char[] CUSTOM_TRUSTSTORE_PASSWORD = "changeit".toCharArray(); |
There was a problem hiding this comment.
you already have TruststoreCommandlet.DEFAULT_TRUSTSTORE_PASSWORD.
Therefore, I would declare all these constants in one of the two places together and reference the String password to build the char[] constant.
There was a problem hiding this comment.
Great, thanks for the rework.
However, you still have the password "changeit" as a constant in TruststoreUtil and in TruststoreCommandletTest.
If I would change only one of the two constants it would break.
So why two constants then if they represent the same thing?
cli/src/main/java/com/devonfw/tools/ide/commandlet/TruststoreCommandlet.java
Show resolved
Hide resolved
cli/src/main/java/com/devonfw/tools/ide/commandlet/TruststoreCommandlet.java
Outdated
Show resolved
Hide resolved
cli/src/main/java/com/devonfw/tools/ide/truststore/TruststoreUtilImpl.java
Outdated
Show resolved
Hide resolved
cli/src/main/java/com/devonfw/tools/ide/truststore/TruststoreUtilImpl.java
Outdated
Show resolved
Hide resolved
cli/src/test/java/com/devonfw/tools/ide/commandlet/StatusCommandletTest.java
Outdated
Show resolved
Hide resolved
| String endpointInput = this.url.getValueAsString(); | ||
| boolean defaultUrlUsed = false; | ||
|
|
||
| if (this.url.getValueAsString() == null || this.url.getValueAsString().isBlank()) { |
There was a problem hiding this comment.
| if (this.url.getValueAsString() == null || this.url.getValueAsString().isBlank()) { | |
| if (endpointInput == null || endpointInput.isBlank()) { |
| LOG.info( | ||
| "This commandlet helps to fix TLS issues for users behind VPNs by capturing untrusted certificates from target endpoints and adding them to a custom truststore. It also configures IDE_OPTIONS to use the custom truststore by default. The commandlet is idempotent and will not make changes if the endpoint is already reachable or if the certificate is already trusted."); |
There was a problem hiding this comment.
Why not just adding this to cmd.fix-vpn-tls-problem.detail?
Currently the I18N support in IDEasy is still questionable since all exception and log messages are hardcoded to English, but since we started this feature, it would be consistent to keep it also for this help text.
| return false; | ||
| } | ||
| String normalized = text.toLowerCase(Locale.ROOT); | ||
| return normalized.contains(ERROR_TEXT_PKIX) || normalized.contains(ERROR_TEXT_CERT_PATH) || normalized.contains(ERROR_TEXT_SSL_HANDSHAKE); |
There was a problem hiding this comment.
But the VSCode issue cannot be fixed by properly configuring the truststore for IDEasy.
VSCode is a separate tool run as an isolated process so it cannot know about our IDEasy truststore.
For me this still does not make sense.
|
|
||
| public static final char[] DEFAULT_CACERTS_PASSWORD = "changeit".toCharArray(); | ||
|
|
||
| public static final char[] CUSTOM_TRUSTSTORE_PASSWORD = "changeit".toCharArray(); |
There was a problem hiding this comment.
Great, thanks for the rework.
However, you still have the password "changeit" as a constant in TruststoreUtil and in TruststoreCommandletTest.
If I would change only one of the two constants it would break.
So why two constants then if they represent the same thing?
| super(context); | ||
| addKeyword(getName()); | ||
| this.url = add(new StringProperty("", false, "url")); | ||
| this.cfg = add(new EnumProperty("--cfg", false, null, EnvironmentVariablesFiles.class)); |
There was a problem hiding this comment.
Now you added this option but do not use it.
This will confuse end-users if you provide a documented option that has no effect.
Either remove it again and we merge and can later add it, or if you keep it then make the truststore location and EnvironmentVariables retrieval dependent on the configured value.
There was a problem hiding this comment.
i removed this feature for now to finish the issue.
…evonfw#1552-add-certificates-to-truststore
…ttps://github.com/MarvMa/IDEasy into feature/devonfw#1552-add-certificates-to-truststore
This PR fixes #1552
Implemented changes:
ide fix-tls-vpn-problem <url>command.The functionality has been tested on Windows 11 and WSL Debian.
Checklist for this PR
Make sure everything is checked before merging this PR. For further info please also see
our DoD.
mvn clean testlocally all tests pass and build is successful#«issue-id»: «brief summary»(e.g.#921: fixed setup.bat). If no issue ID exists, title only.In Progressand assigned to you or there is no issue (might happen for very small PRs)with
internalChecklist for tool commandlets
Have you added a new
«tool»as commandlet? There are the following additional checks:«tool»«TOOL»_VERSIONand«TOOL»_EDITIONare honored by your commandlet