Creating an Application Link fails with java.io.IOException: DER length more than 4 bytes
Platform Notice: Cloud and Data Center - This article applies equally to both cloud and data center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Problem
When setting up an application link between an Atlassian Server application and an Atlassian Cloud application you receive the following error in the application logs:
1
2
3
4
5
6
7
8
9
10
11
12
13
A system error has occurred.
java.lang.RuntimeException: java.security.spec.InvalidKeySpecException: java.io.IOException: DER length more than 4 bytes
at com.atlassian.security.auth.trustedapps.ListApplicationRetriever.getApplicationProtocolV0(ListApplicationRetriever.java:93)
at com.atlassian.security.auth.trustedapps.ListApplicationRetriever.getApplicationProtocolV1(ListApplicationRetriever.java:52)
at com.atlassian.security.auth.trustedapps.ListApplicationRetriever.getApplication(ListApplicationRetriever.java:46)
at com.atlassian.security.auth.trustedapps.ReaderApplicationRetriever.getApplication(ReaderApplicationRetriever.java:27)
at com.atlassian.security.auth.trustedapps.InputStreamApplicationRetriever.getApplication(InputStreamApplicationRetriever.java:21)
...
Caused by: java.security.spec.InvalidKeySpecException: java.io.IOException: DER length more than 4 bytes
at org.bouncycastle.jce.provider.JDKKeyFactory.engineGeneratePublic(Unknown Source)
at org.bouncycastle.jce.provider.JDKKeyFactory$RSA.engineGeneratePublic(Unknown Source)
...
Referer URL: http://jira.example.com:8080/plugins/servlet/applinks/auth/conf/trusted/inbound-non-ual/XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
Cause
Application links between Server and Cloud instances can only be performed if your Server application is running on either port 80 or port 443 (with valid SSL certificates). The instance also needs to be accessible publicly over the internet.
The Referer URL in the above error message may display that your Server instance is running on port 8080 or some other non standard port for web applications.
Resolution
Make sure that your Atlassian Server application is running on either port 80 or port 443 (with valid SSL certificates) and can be accessed over the internet.
If you have any doubts on how to configure this please contact the Atlassian Server support team at https://support.atlassian.com
Was this helpful?