Class SSLContext

All Implemented Interfaces:
AutoCloseable

public class SSLContext
extends CFType
  • Constructor Details

    • SSLContext

      protected SSLContext()
  • Method Details

    • create

      public static SSLContext create​(SSLProtocolSide protocolSide, SSLConnectionType connectionType)
      Since:
      Available in iOS 5.0 and later.
    • getSessionState

      public SSLSessionState getSessionState() throws OSStatusException
      Throws:
      OSStatusException
      Since:
      Available in iOS 5.0 and later.
    • setSessionOption

      public void setSessionOption​(SSLSessionOption option, boolean value) throws OSStatusException
      Throws:
      OSStatusException
      Since:
      Available in iOS 5.0 and later.
    • getSessionOption

      public boolean getSessionOption​(SSLSessionOption option) throws OSStatusException
      Throws:
      OSStatusException
      Since:
      Available in iOS 5.0 and later.
    • setMinProtocolVersion

      public void setMinProtocolVersion​(SSLProtocol minVersion) throws OSStatusException
      Throws:
      OSStatusException
      Since:
      Available in iOS 5.0 and later.
    • getMinProtocolVersion

      public SSLProtocol getMinProtocolVersion() throws OSStatusException
      Throws:
      OSStatusException
      Since:
      Available in iOS 5.0 and later.
    • setMaxProtocolVersion

      public void setMaxProtocolVersion​(SSLProtocol maxVersion) throws OSStatusException
      Throws:
      OSStatusException
      Since:
      Available in iOS 5.0 and later.
    • getMaxProtocolVersion

      public SSLProtocol getMaxProtocolVersion() throws OSStatusException
      Throws:
      OSStatusException
      Since:
      Available in iOS 5.0 and later.
    • setCertificate

      public void setCertificate​(SecIdentity identity, SecCertificate... certificates) throws OSStatusException
      Throws:
      OSStatusException
      Since:
      Available in iOS 5.0 and later.
    • setEncryptionCertificate

      public void setEncryptionCertificate​(SecIdentity identity, SecCertificate... certificates) throws OSStatusException
      Throws:
      OSStatusException
      Since:
      Available in iOS 5.0 and later.
    • setConnection

      public void setConnection​(VoidPtr connection) throws OSStatusException
      Throws:
      OSStatusException
      Since:
      Available in iOS 5.0 and later.
    • getConnection

      public VoidPtr getConnection() throws OSStatusException
      Throws:
      OSStatusException
      Since:
      Available in iOS 5.0 and later.
    • setPeerDomainName

      public void setPeerDomainName​(String peerName) throws OSStatusException
      Throws:
      OSStatusException
      Since:
      Available in iOS 5.0 and later.
    • getPeerDomainName

      public String getPeerDomainName() throws OSStatusException
      Throws:
      OSStatusException
      Since:
      Available in iOS 5.0 and later.
    • setDatagramHelloCookie

      public void setDatagramHelloCookie​(byte[] cookie) throws OSStatusException
      Throws:
      OSStatusException
      Since:
      Available in iOS 5.0 and later.
    • setMaxDatagramRecordSize

      public void setMaxDatagramRecordSize​(long maxSize) throws OSStatusException
      Throws:
      OSStatusException
      Since:
      Available in iOS 5.0 and later.
    • getMaxDatagramRecordSize

      public long getMaxDatagramRecordSize() throws OSStatusException
      Throws:
      OSStatusException
      Since:
      Available in iOS 5.0 and later.
    • getNegotiatedProtocolVersion

      public SSLProtocol getNegotiatedProtocolVersion() throws OSStatusException
      Throws:
      OSStatusException
      Since:
      Available in iOS 5.0 and later.
    • getNumberSupportedCiphers

      public long getNumberSupportedCiphers() throws OSStatusException
      Throws:
      OSStatusException
      Since:
      Available in iOS 5.0 and later.
    • getSupportedCiphers

      public short[] getSupportedCiphers() throws OSStatusException
      Throws:
      OSStatusException
      Since:
      Available in iOS 5.0 and later.
    • setEnabledCiphers

      public void setEnabledCiphers​(short[] ciphers) throws OSStatusException
      Throws:
      OSStatusException
      Since:
      Available in iOS 5.0 and later.
    • getNumberEnabledCiphers

      public long getNumberEnabledCiphers() throws OSStatusException
      Throws:
      OSStatusException
      Since:
      Available in iOS 5.0 and later.
    • getEnabledCiphers

      public short[] getEnabledCiphers() throws OSStatusException
      Throws:
      OSStatusException
      Since:
      Available in iOS 5.0 and later.
    • getPeerTrust

      public SecTrust getPeerTrust() throws OSStatusException
      Throws:
      OSStatusException
      Since:
      Available in iOS 5.0 and later.
    • setPeerID

      public void setPeerID​(String peerID) throws OSStatusException
      Throws:
      OSStatusException
      Since:
      Available in iOS 5.0 and later.
    • getPeerID

      public String getPeerID() throws OSStatusException
      Throws:
      OSStatusException
      Since:
      Available in iOS 5.0 and later.
    • getNegotiatedCipher

      public short getNegotiatedCipher() throws OSStatusException
      Throws:
      OSStatusException
      Since:
      Available in iOS 5.0 and later.
    • setClientSideAuthenticate

      public void setClientSideAuthenticate​(SSLAuthenticate auth) throws OSStatusException
      Throws:
      OSStatusException
      Since:
      Available in iOS 5.0 and later.
    • addDistinguishedName

      public void addDistinguishedName​(NSData derDN) throws OSStatusException
      Throws:
      OSStatusException
      Since:
      Available in iOS 5.0 and later.
    • getDistinguishedNames

      public NSArray<NSData> getDistinguishedNames() throws OSStatusException
      Throws:
      OSStatusException
      Since:
      Available in iOS 5.0 and later.
    • getClientCertificateState

      public SSLClientCertificateState getClientCertificateState() throws OSStatusException
      Throws:
      OSStatusException
      Since:
      Available in iOS 5.0 and later.
    • handshake

      public void handshake() throws OSStatusException
      Throws:
      OSStatusException
      Since:
      Available in iOS 5.0 and later.
    • write

      public long write​(byte[] data) throws OSStatusException
      Throws:
      OSStatusException
      Since:
      Available in iOS 5.0 and later.
    • read

      public byte[] read​(int dataLength) throws OSStatusException
      Throws:
      OSStatusException
      Since:
      Available in iOS 5.0 and later.
    • getBufferedReadSize

      public int getBufferedReadSize() throws OSStatusException
      Throws:
      OSStatusException
      Since:
      Available in iOS 5.0 and later.
    • getDatagramWriteSize

      public int getDatagramWriteSize() throws OSStatusException
      Throws:
      OSStatusException
      Since:
      Available in iOS 5.0 and later.
    • closeContext

      public void closeContext() throws OSStatusException
      Throws:
      OSStatusException
      Since:
      Available in iOS 5.0 and later.
    • kSSLSessionConfig_default

      @Deprecated public static String kSSLSessionConfig_default()
      Deprecated.
      Deprecated in iOS 11.0. No longer supported. Use Network.framework.
    • kSSLSessionConfig_ATSv1

      @Deprecated public static String kSSLSessionConfig_ATSv1()
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • kSSLSessionConfig_ATSv1_noPFS

      @Deprecated public static String kSSLSessionConfig_ATSv1_noPFS()
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • kSSLSessionConfig_standard

      @Deprecated public static String kSSLSessionConfig_standard()
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • kSSLSessionConfig_RC4_fallback

      @Deprecated public static String kSSLSessionConfig_RC4_fallback()
      Deprecated.
      Deprecated in iOS 11.0. No longer supported. Use Network.framework.
    • kSSLSessionConfig_TLSv1_fallback

      @Deprecated public static String kSSLSessionConfig_TLSv1_fallback()
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • kSSLSessionConfig_TLSv1_RC4_fallback

      @Deprecated public static String kSSLSessionConfig_TLSv1_RC4_fallback()
      Deprecated.
      Deprecated in iOS 11.0. No longer supported. Use Network.framework.
    • kSSLSessionConfig_legacy

      @Deprecated public static String kSSLSessionConfig_legacy()
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • kSSLSessionConfig_legacy_DHE

      @Deprecated public static String kSSLSessionConfig_legacy_DHE()
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • kSSLSessionConfig_anonymous

      @Deprecated public static String kSSLSessionConfig_anonymous()
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • kSSLSessionConfig_3DES_fallback

      @Deprecated public static String kSSLSessionConfig_3DES_fallback()
      Deprecated.
      Deprecated in iOS 11.0. No longer supported. Use Network.framework.
    • kSSLSessionConfig_TLSv1_3DES_fallback

      @Deprecated public static String kSSLSessionConfig_TLSv1_3DES_fallback()
      Deprecated.
      Deprecated in iOS 11.0. No longer supported. Use Network.framework.
    • getClassTypeID

      @Deprecated public static long getClassTypeID()
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • create0

      @Deprecated protected static SSLContext create0​(CFAllocator alloc, SSLProtocolSide protocolSide, SSLConnectionType connectionType)
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • getSessionState0

      @Deprecated protected OSStatus getSessionState0​(IntPtr state)
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • setSessionOption0

      @Deprecated protected OSStatus setSessionOption0​(SSLSessionOption option, boolean value)
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • getSessionOption0

      @Deprecated protected OSStatus getSessionOption0​(SSLSessionOption option, BooleanPtr value)
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • setIOFunctions0

      @Deprecated protected OSStatus setIOFunctions0​(FunctionPtr readFunc, FunctionPtr writeFunc)
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • setSessionConfig0

      @Deprecated protected OSStatus setSessionConfig0​(String config)
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
      Since:
      Available in iOS 10.0 and later.
    • setMinProtocolVersion0

      @Deprecated protected OSStatus setMinProtocolVersion0​(SSLProtocol minVersion)
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • getMinProtocolVersion0

      @Deprecated protected OSStatus getMinProtocolVersion0​(IntPtr minVersion)
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • setMaxProtocolVersion0

      @Deprecated protected OSStatus setMaxProtocolVersion0​(SSLProtocol maxVersion)
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • getMaxProtocolVersion0

      @Deprecated protected OSStatus getMaxProtocolVersion0​(IntPtr maxVersion)
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • setCertificate0

      @Deprecated protected OSStatus setCertificate0​(CFArray certRefs)
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • setConnection0

      @Deprecated protected OSStatus setConnection0​(VoidPtr connection)
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • getConnection0

      @Deprecated protected OSStatus getConnection0​(VoidPtr.VoidPtrPtr connection)
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • setPeerDomainName0

      @Deprecated protected OSStatus setPeerDomainName0​(long peerName, long peerNameLen)
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • getPeerDomainNameLength0

      @Deprecated protected OSStatus getPeerDomainNameLength0​(MachineSizedUIntPtr peerNameLen)
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • getPeerDomainName0

      @Deprecated protected OSStatus getPeerDomainName0​(BytePtr peerName, MachineSizedUIntPtr peerNameLen)
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • copyRequestedPeerNameLength0

      @Deprecated protected OSStatus copyRequestedPeerNameLength0​(MachineSizedUIntPtr peerNameLen)
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
      Since:
      Available in iOS 9.0 and later.
    • copyRequestedPeerName0

      @Deprecated protected OSStatus copyRequestedPeerName0​(BytePtr peerName, MachineSizedUIntPtr peerNameLen)
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
      Since:
      Available in iOS 9.0 and later.
    • setDatagramHelloCookie0

      @Deprecated protected OSStatus setDatagramHelloCookie0​(long cookie, long cookieLen)
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • setMaxDatagramRecordSize0

      @Deprecated protected OSStatus setMaxDatagramRecordSize0​(long maxSize)
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • getMaxDatagramRecordSize0

      @Deprecated protected OSStatus getMaxDatagramRecordSize0​(MachineSizedUIntPtr maxSize)
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • getNegotiatedProtocolVersion0

      @Deprecated protected OSStatus getNegotiatedProtocolVersion0​(IntPtr protocol)
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • getNumberSupportedCiphers0

      @Deprecated protected OSStatus getNumberSupportedCiphers0​(MachineSizedUIntPtr numCiphers)
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • getSupportedCiphers0

      @Deprecated protected OSStatus getSupportedCiphers0​(ShortPtr ciphers, MachineSizedUIntPtr numCiphers)
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • getNumberEnabledCiphers0

      @Deprecated protected OSStatus getNumberEnabledCiphers0​(MachineSizedUIntPtr numCiphers)
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • setEnabledCiphers0

      @Deprecated protected OSStatus setEnabledCiphers0​(long ciphers, long numCiphers)
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • getEnabledCiphers0

      @Deprecated protected OSStatus getEnabledCiphers0​(ShortPtr ciphers, MachineSizedUIntPtr numCiphers)
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • setSessionTicketsEnabled0

      @Deprecated protected OSStatus setSessionTicketsEnabled0​(boolean enabled)
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
      Since:
      Available in iOS 11.0 and later.
    • getPeerTrust0

      @Deprecated protected OSStatus getPeerTrust0​(SecTrust.SecTrustPtr trust)
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • setPeerID0

      @Deprecated protected OSStatus setPeerID0​(long peerID, long peerIDLen)
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • getPeerID0

      @Deprecated protected OSStatus getPeerID0​(BytePtr.BytePtrPtr peerID, MachineSizedUIntPtr peerIDLen)
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • getNegotiatedCipher0

      @Deprecated protected OSStatus getNegotiatedCipher0​(ShortPtr cipherSuite)
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • setALPNProtocols0

      @Deprecated protected OSStatus setALPNProtocols0​(NSArray protocols)
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
      Since:
      Available in iOS 11.0 and later.
    • getALPNProtocols0

      @Deprecated protected OSStatus getALPNProtocols0​(NSArray.NSArrayPtr<NSData> protocols)
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
      Since:
      Available in iOS 11.0 and later.
    • setOCSPResponse0

      @Deprecated protected OSStatus setOCSPResponse0​(NSData response)
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
      Since:
      Available in iOS 11.0 and later.
    • setEncryptionCertificate0

      @Deprecated protected OSStatus setEncryptionCertificate0​(CFArray certRefs)
      Deprecated.
      Deprecated in iOS 9.0. No longer supported. Use Network.framework.
    • setClientSideAuthenticate0

      @Deprecated protected OSStatus setClientSideAuthenticate0​(SSLAuthenticate auth)
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • addDistinguishedName0

      @Deprecated protected OSStatus addDistinguishedName0​(long derDN, long derDNLen)
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • getDistinguishedNames0

      @Deprecated protected OSStatus getDistinguishedNames0​(NSArray.NSArrayPtr<NSData> names)
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • getClientCertificateState0

      @Deprecated protected OSStatus getClientCertificateState0​(IntPtr clientState)
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • handshake0

      @Deprecated protected OSStatus handshake0()
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • reHandshake0

      @Deprecated protected OSStatus reHandshake0()
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
      Since:
      Available in iOS 10.0 and later.
    • write0

      @Deprecated protected OSStatus write0​(long data, long dataLength, MachineSizedUIntPtr processed)
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • read0

      @Deprecated protected OSStatus read0​(BytePtr data, long dataLength, MachineSizedUIntPtr processed)
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • getBufferedReadSize0

      @Deprecated protected OSStatus getBufferedReadSize0​(MachineSizedUIntPtr bufferSize)
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • getDatagramWriteSize0

      @Deprecated protected OSStatus getDatagramWriteSize0​(MachineSizedUIntPtr bufSize)
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • closeContext0

      @Deprecated protected OSStatus closeContext0()
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
    • setError0

      @Deprecated protected OSStatus setError0​(OSStatus status)
      Deprecated.
      Deprecated in iOS 13.0. No longer supported. Use Network.framework.
      Since:
      Available in iOS 11.0 and later.