iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/csiv2/CSIv2Util.java
public static TaggedComponent createSSLTaggedComponent(IORSecurityConfigMetaData metadata, Codec codec, int sslPort,
                                                           ORB orb) {
        if (metadata == null) {
            IIOPLogger.ROOT_LOGGER.debug("Method createSSLTaggedComponent() called with null metadata");
            return null;
        }

        if (sslPort == 0) {
            // no support for transport security.
            return null;
        }

        TaggedComponent tc;
        try {
            int supports = createTargetSupports(metadata.getTransportConfig());
            int requires = createTargetRequires(metadata.getTransportConfig());
            SSL ssl = new SSL((short) supports, (short) requires, (short) sslPort);
            Any any = orb.create_any();
            SSLHelper.insert(any, ssl);
            byte[] componentData = codec.encode_value(any);
            tc = new TaggedComponent(TAG_SSL_SEC_TRANS.value, componentData);
        } catch (InvalidTypeForEncoding e) {
            throw IIOPLogger.ROOT_LOGGER.unexpectedException(e);
        }
        return tc;
    }
public static TaggedComponent createSSLTaggedComponent(IORSecurityConfigMetaData metadata, Codec codec, int sslPort,
                                                           ORB orb) {
        if (metadata == null) {
            IIOPLogger.ROOT_LOGGER.debug("Method createSSLTaggedComponent() called with null metadata");
            return null;
        }

        if (sslPort == 0) {
            // no support for transport security.
            return null;
        }

        TaggedComponent tc;
        try {
            int supports = createTargetSupports(metadata.getTransportConfig());
            int requires = createTargetRequires(metadata.getTransportConfig());
            SSL ssl = new SSL((short) supports, (short) requires, (short) sslPort);
            Any any = orb.create_any();
            SSLHelper.insert(any, ssl);
            byte[] componentData = codec.encode_value(any);
            tc = new TaggedComponent(TAG_SSL_SEC_TRANS.value, componentData);
        } catch (InvalidTypeForEncoding e) {
            throw IIOPLogger.ROOT_LOGGER.unexpectedException(e);
        }
        return tc;
    }
public static TaggedComponent createSSLTaggedComponent ( IORSecurityConfigMetaData metadata , Codec codec , int sslPort , ORB orb ) { if ( metadata == null ) { IIOPLogger . ROOT_LOGGER . debug ( "Method createSSLTaggedComponent() called with null metadata" ) ; return null ; } if ( sslPort == 0 ) { // no support for transport security. return null ; } TaggedComponent tc ; try { int supports = createTargetSupports ( metadata . getTransportConfig ( ) ) ; int requires = createTargetRequires ( metadata . getTransportConfig ( ) ) ; SSL ssl = new SSL ( ( short ) supports , ( short ) requires , ( short ) sslPort ) ; Any any = orb . create_any ( ) ; SSLHelper . insert ( any , ssl ) ; byte [ ] componentData = codec . encode_value ( any ) ; tc = new TaggedComponent ( TAG_SSL_SEC_TRANS . value , componentData ) ; } catch ( InvalidTypeForEncoding e ) { throw IIOPLogger . ROOT_LOGGER . unexpectedException ( e ) ; } return tc ; }
<p>
Return a top-level {@code IOP::TaggedComponent} to be stuffed into an IOR, containing a structure
{@code SSLIOP::SSL}, tagged as {@code TAG_SSL_SEC_TRANS}.
</p>
<p>
Should be called with non-null metadata, in which case we probably don't want to include security info in the IOR.
</p>

@param metadata the metadata object that contains the SSL configuration info.
@param codec    the {@code Codec} used to encode the SSL component.
@param sslPort  an {@code int} representing the SSL port.
@param orb      a reference to the running {@code ORB}.
@return a {@code TaggedComponent} representing the encoded SSL component.
<p > Return a top - level { @code IOP :: TaggedComponent } to be stuffed into an IOR containing a structure { @code SSLIOP :: SSL } tagged as { @code TAG_SSL_SEC_TRANS } . < / p > <p > Should be called with non - null metadata in which case we probably don t want to include security info in the IOR . < / p >