make outgoing http request from within confluence for content?

I'm using one of Bob Swift's great script plugins:

https://bobswift.atlassian.net/wiki/display/SCRP/Groovy+Macro

and attempting to grab some ouptul from an external site for inclusion in confluence via an HTTP request. The data I'm trying to grab is an XML file which I then need to format. I verified the script works but get the following error what it's put into confluence:

Error rendering macro 'groovy' : javax/security/auth/x500/X500Principal

I'm assuming this is due to security restrictions (which makes sense, in retrospect). What options do I have?


1 answer

Are you attempting to grab the content via https://? If so, you'll need to add the remote servers certificate to your java keystore.

hmm...still get the same issue, and strangely enough, even when requesting a non-ssl page. This should be permissible as far as you know? I'll see if I can't contact the plugin author directly...

Just an update here: While this does work with a http (non-ssl) request, I'm still seeing the issue with SSL requests. It seems the Groovy plugin is not able to get access to javax.security.* as I get the below stacktrace. Strangely, the class is part of the standard runtime libraries (rt.jar) of the JRE

java.lang.ClassNotFoundException: javax.security.auth.x500.X500Principal
org.apache.http.conn.ssl.AbstractVerifier.getCNs(AbstractVerifier.java:264)
org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:147) 

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

2,919 views 27 12
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you