web stats
Custom Extension and Jar Signing - Mirth Community

Go Back   Mirth Community > Mirth Connect > Development

Reply
 
Thread Tools Display Modes
  #1  
Old 04-25-2019, 02:51 PM
nperry nperry is offline
What's HL7?
 
Join Date: Mar 2017
Posts: 2
nperry is on a distinguished road
Default Custom Extension and Jar Signing

Hello Mirth community! I'm having a bit of trouble with signjar. I will be upfront that I'm not super familiar with the process of using it for code signing (besides reading a couple docs online) but here we are. I'll give as much instruction to my process, and hopefully I can get this resolved.

I'm working on a custom extension, a variant of a source connector. Let's call it 'File Reader Alt'

I checked out the '3.7.1' tag from GitHub to make my changes, as this is the latest version of Mirth. I went with the approach of adding my code on top of the Mirth code base and modified the ant build scripts to build and package my new plugin. This was not from any particular guideline I found on the forums, just from my own attempt to get the thing to build.

I built the project with Ant 1.10 and the Oracle JDK 8 (rv. 202) on Ubuntu 19.04.
It produced an folder within the mirth-connect/server/setup directory that had all of my jar files. I zipped this up (that I did find on the forums!), and now have a file-reader-alt-3.7.1.zip

That this point, I went to my Administrator client connected to my Mirth 3.7.1 server. The server is running on Ubuntu 18.04, under openJDK 11 (the default jre) and backed by postgresql 10. I imported the zip folder in the 'Extensions' screen, and then restarted the server and Admin client as instructed. When I attempted to launch the Admin client after the restart, I got the following error:
Code:
com.mirth.connect.client.launcher.q: java.lang.Exception: Error verifying entry "META-INF/MANIFEST.MF" in JAR file file-reader-alt-client.jar
java.util.concurrent.ExecutionException: com.mirth.connect.client.launcher.q: java.lang.Exception: Error verifying entry "META-INF/MANIFEST.MF" in JAR file file-reader-alt-client.jar
	at java.util.concurrent.FutureTask.report(Unknown Source)
	at java.util.concurrent.FutureTask.get(Unknown Source)
	at com.mirth.connect.client.launcher.f.a(SourceFile:406)
	at com.mirth.connect.client.launcher.f.a(SourceFile:372)
	at com.mirth.connect.client.launcher.MirthClientLauncher.run(SourceFile:1122)
	at java.lang.Thread.run(Unknown Source)
Caused by: com.mirth.connect.client.launcher.q: java.lang.Exception: Error verifying entry "META-INF/MANIFEST.MF" in JAR file file-reader-alt-client.jar
	at com.mirth.connect.client.launcher.r.a(SourceFile:240)
	at com.mirth.connect.client.launcher.r.a(SourceFile:178)
	at com.mirth.connect.client.launcher.f.a(SourceFile:540)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	... 1 more
Caused by: java.lang.Exception: Error verifying entry "META-INF/MANIFEST.MF" in JAR file file-reader-alt-client.jar
	at com.mirth.connect.client.launcher.r.a(SourceFile:227)
	... 6 more
Caused by: java.lang.Exception: Certificate CN=mirth-connect does not have required code signing extension.
	at com.mirth.connect.client.launcher.r.a(SourceFile:400)
	at com.mirth.connect.client.launcher.r.a(SourceFile:294)
	at com.mirth.connect.client.launcher.r.a(SourceFile:219)
	... 6 more
Definitely not the most exciting thing to see. I started googling and digging into the forums, but I didn't see much that seemed relevant to this specific issue.
I started a process of opening up the jar files and looking at the manifest files. It was clear that what I had built and signed was very different from the server. This keyed me onto thinking 'hey, I should look at the keystore on the server versus what came from the checked out code'. This showed me that the two keystores were different. I attempted to re-sign my jarfiles with the keystore from the server. That resulted in the same error. I then attempted to replace what was used during the build with the keystore from the server, but that resulted in the same error as well.

And here we are. Sorry for the book, but I figured describing everything would be more helpful than a sentence saying 'help me!'. My question then is, what is the process for properly signing and deploying a custom extension onto a Mirth server? I tried looking through the community wiki (the only thing I found about extensions) and even found a post on the forums where someone ran into a MANIFEST file issue (http://www.mirthcorp.com/community/f...d.php?t=217108), but nothing seemed to match up.

Thank you very much for any help you can provide
Reply With Quote
  #2  
Old 04-26-2019, 09:52 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,089
narupley is on a distinguished road
Default

The certificate used to sign your extensions must be a code signing cert and be properly signed by a CA.
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
  #3  
Old 05-02-2019, 08:33 AM
nperry nperry is offline
What's HL7?
 
Join Date: Mar 2017
Posts: 2
nperry is on a distinguished road
Default

I was able to look into code signing certs and understand what I was missing. Thank you very much for the clarification!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 10:12 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation