export sun security packages as optional

Fix for issue #2565