How to configure Mendix studio in a proxy environment to solve error CE9805 when syncing Java deps

2
When importing Marketplace modules using Java deps error CE9805 is produced due to certificate issues, to reproduce it's very simple, create new app and add for example the excel exporter module from the Marketplace.   CE9805 Java dependency syncronisation failed because one or more repositories could not be found and stacktrace: FAILURE: Build failed with an exception. * What went wrong:Execution failed for task ':copyDependencies'.> Could not resolve all files for configuration ':implementation'.   > Could not resolve org.apache.poi:poi-ooxml:5.2.2.     Required by:         project :      > Could not resolve org.apache.poi:poi-ooxml:5.2.2.         > Could not get resource 'https://repo.maven.apache.org/maven2/org/apache/poi/poi-ooxml/5.2.2/poi-ooxml-5.2.2.pom'.            > Could not GET 'https://repo.maven.apache.org/maven2/org/apache/poi/poi-ooxml/5.2.2/poi-ooxml-5.2.2.pom'.               > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.6/userguide/build_environment.html#gradle_system_properties                  > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target * Try:> Run with --stacktrace option to get the stack trace.> Run with --info or --debug option to get more log output.> Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 7s   Reason is the corporate proxy. So to solve this I'm thinking of: - Set insecuressl on true (Works with reg Java Maven) - Add the corporate certificates to the JVM (I don't know which JVM is Used by Mendix studio)   Does anyone recognise this error and knows how to fix this?    
asked
1 answers
2

Hello Austin,

 

Yes, I did. You need to add the proxy certificate to the Java JVM used by Mendix. You will need to have the certificate file from the proxy, this can be downloaded from your browser or ask somebody from the IT department for this file. It should be a file ending with .cer

Here is how to do this.

- Open Mendix and select edit>preferences

screen 1.png 

 

- In the preference popup select the deployment tab:

 

screen 2.png

 

- Make a note of the JDK directory

- Open a cmd shell and go to the noted directory (the first command in the screenshot below starting with cd):

screen 3.png

- run the second command staring with a dot, changing <<COMP.CERT.NAME>> with a arbitrary name convention is to use the certificate name whitout .cer and replace <<CERT.FILE.NAME>> with the location and filename of the cer file, as example if you downloaded mycomp.cer to C:\ you use C:\mycomp.cer

If all goes well executing the second command will ask for a password, the default password is changeit 

 

Thats all, restart Mendix and the error should disappear. If your company is using an internal Maven repository (They almost all do in a corporate environment using Java) you can configure Mendix do use this internal repository (this should be the preferred configuration from a security standpoint). You can add a init.gradle file in your user home .gradle subdirectory with the following content:

allprojects {

  ext.RepoConfigurator = {

    maven {

      url = uri('https://<<url of used repository like nexus or artifactory>>/') }

  }

  buildscript.repositories RepoConfigurator

  repositories RepoConfigurator

}

 

All of this can be done without admin rights

answered