Support encryption in Collaborative Editing (synchrony.encryption.disabled=false)

XMLWordPrintable

    • 1
    • Severity 2 - Major

      Issue Summary

      This is reproducible on Data Center: (yes)

      Steps to Reproduce

      1. Deploy Confluence DC in Kubernetes.
      2. Set in confluence.cfg.xml from Confluence Home 
        <property name="synchrony.encryption.disabled">false</property> 
      3. Delete Confluence pod.
      4. Once Confluence restarted, attempt to Create or Edit a page.

      Logs

      The below error logs can be seen in the atlassian.confluence.log files:

      Caused by: java.security.spec.InvalidKeySpecException: java.security.InvalidKeyException: Unable to decode key
      	at java.base/sun.security.rsa.RSAKeyFactory.engineGeneratePublic(RSAKeyFactory.java:241)
      	at java.base/java.security.KeyFactory.generatePublic(KeyFactory.java:351)
      	at com.atlassian.confluence.plugins.synchrony.service.SynchronyJsonWebTokenGenerator.encryptSignedJWT(SynchronyJsonWebTokenGenerator.java:174)
      	at com.atlassian.confluence.plugins.synchrony.service.SynchronyJsonWebTokenGenerator.create(SynchronyJsonWebTokenGenerator.java:128)
      	at com.atlassian.confluence.plugins.synchrony.service.SynchronyJsonWebTokenGenerator.createAdminToken(SynchronyJsonWebTokenGenerator.java:63)
      	... 84 more
      Caused by: java.security.InvalidKeyException: Unable to decode key
      	at java.base/sun.security.x509.X509Key.decode(X509Key.java:375)
      	at java.base/sun.security.rsa.RSAPublicKeyImpl.<init>(RSAPublicKeyImpl.java:148)
      	at java.base/sun.security.rsa.RSAPublicKeyImpl.newKey(RSAPublicKeyImpl.java:80)
      	at java.base/sun.security.rsa.RSAKeyFactory.generatePublic(RSAKeyFactory.java:324)
      	at java.base/sun.security.rsa.RSAKeyFactory.engineGeneratePublic(RSAKeyFactory.java:237)
      	... 88 more
      Caused by: java.io.IOException: Invalid lenByte
      	at java.base/sun.security.util.DerValue.<init>(DerValue.java:406)
      	at java.base/sun.security.util.DerValue.<init>(DerValue.java:344)
      	at java.base/sun.security.x509.X509Key.decode(X509Key.java:373)
      	... 92 more
      
      2024-11-15 10:48:26,082 ERROR [http-nio-8090-exec-5 url: /plugins/editor-loader/editor.action; user: UAXXX0] [confluence.plugins.synchrony.SynchronyContextProvider] getContextMap java.security.InvalidKeyException: IOException: DerInputStream.getLength(): lengthTag=105, too big.
      
       -- traceId: 43324c4c69a58ea0 | page: 194281477 | url: /plugins/editor-loader/editor.action | referer: https://confluence.XXXXX.display/~UXXXX/Test?focusedCommentId=202899457 | userName: UXXXX | space: 178126849 | action: editor
      
      2024-11-28 15:27:03,918 ERROR [ipd-worker:thread-1] [diagnostics.internal.ipd.DefaultIpdJobRunner] runJobs Error during executing com.atlassian.confluence.internal.diagnostics.ipd.http.HttpRecentSessionsInProductDiagnosticJob job
      java.lang.NullPointerException: Cannot invoke "String.replace(java.lang.CharSequence, java.lang.CharSequence)" because the return value of "com.atlassian.confluence.core.ContextPathHolder.getContextPath()" is null
      	at com.atlassian.confluence.internal.diagnostics.ipd.http.IpdSessionMonitoringService.hasConfluenceContextPath(IpdSessionMonitoringService.java:52)
      ...
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
      	at java.base/java.lang.Thread.run(Thread.java:840)
      2024-11-28 15:27:03,923 ERROR [ipd-worker:thread-1] [diagnostics.internal.ipd.DefaultIpdJobRunner] runJobs Error during executing com.atlassian.confluence.internal.diagnostics.ipd.http.HttpActiveSessionInProductDiagnosticJob job
      java.lang.NullPointerException: Cannot invoke "String.replace(java.lang.CharSequence, java.lang.CharSequence)" because the return value of "com.atlassian.confluence.core.ContextPathHolder.getContextPath()" is null
      	at com.atlassian.confluence.internal.diagnostics.ipd.http.IpdSessionMonitoringService.hasConfluenceContextPath(IpdSessionMonitoringService.java:52)
      	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:178)
      	at java.base/java.util.HashMap$KeySpliterator.tryAdvance(HashMap.java:1728)
      

      Expected Results

      Pages can be created/edited.

      Actual Results

      The below exception is thrown in the atlassian-confluence.log file:

      2024-11-28 11:49:02,777 ERROR [http-nio-8090-exec-9 url: /confluence/pages/createpage.action; user: admin] [confluence.plugins.synchrony.SynchronyContextProvider] getContextMap java.security.InvalidKeyException: IOException: DerInputStream.getLength(): lengthTag=105, too big. 

      Workaround

      1. Set in confluence.cfg.xml from Confluence Home:
        <property name="synchrony.encryption.disabled">true</property> 
      2. Delete Confluence pod.

      Collaborative Editing works as expected.

            Assignee:
            Unassigned
            Reporter:
            Marco Salvi (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: