2017-09-12 20:42:36 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
2022-02-14 13:18:53 +00:00
<class name= "StreamPeerSSL" inherits= "StreamPeer" version= "4.0" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "../class.xsd" >
2017-09-12 20:42:36 +00:00
<brief_description >
2019-06-21 23:04:47 +00:00
SSL stream peer.
2017-09-12 20:42:36 +00:00
</brief_description>
<description >
2019-09-23 16:16:41 +00:00
SSL stream peer. This object can be used to connect to an SSL server or accept a single SSL client connection.
2021-08-10 15:47:09 +00:00
[b]Note:[/b] When exporting to Android, make sure to enable the [code]INTERNET[/code] permission in the Android export preset before exporting the project or using one-click deploy. Otherwise, network communication of any kind will be blocked by Android.
2017-09-12 20:42:36 +00:00
</description>
<tutorials >
2021-11-15 09:43:07 +00:00
<link title= "SSL certificates" > $DOCS_URL/tutorials/networking/ssl_certificates.html</link>
2017-09-12 20:42:36 +00:00
</tutorials>
<methods >
<method name= "accept_stream" >
2021-07-30 13:28:05 +00:00
<return type= "int" enum= "Error" />
<argument index= "0" name= "stream" type= "StreamPeer" />
<argument index= "1" name= "private_key" type= "CryptoKey" />
<argument index= "2" name= "certificate" type= "X509Certificate" />
<argument index= "3" name= "chain" type= "X509Certificate" default= "null" />
2017-09-12 20:42:36 +00:00
<description >
2019-09-23 16:16:41 +00:00
Accepts a peer connection as a server using the given [code]private_key[/code] and providing the given [code]certificate[/code] to the client. You can pass the optional [code]chain[/code] parameter to provide additional CA chain information along with the certificate.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "connect_to_stream" >
2021-07-30 13:28:05 +00:00
<return type= "int" enum= "Error" />
<argument index= "0" name= "stream" type= "StreamPeer" />
<argument index= "1" name= "validate_certs" type= "bool" default= "false" />
<argument index= "2" name= "for_hostname" type= "String" default= """" />
<argument index= "3" name= "valid_certificate" type= "X509Certificate" default= "null" />
2017-09-12 20:42:36 +00:00
<description >
2019-06-21 23:04:47 +00:00
Connects to a peer using an underlying [StreamPeer] [code]stream[/code]. If [code]validate_certs[/code] is [code]true[/code], [StreamPeerSSL] will validate that the certificate presented by the peer matches the [code]for_hostname[/code].
2020-01-14 12:54:31 +00:00
[b]Note:[/b] Specifying a custom [code]valid_certificate[/code] is not supported in HTML5 exports due to browsers restrictions.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "disconnect_from_stream" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
2017-09-12 20:42:36 +00:00
<description >
2019-06-21 23:04:47 +00:00
Disconnects from host.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "get_status" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "int" enum= "StreamPeerSSL.Status" />
2017-09-12 20:42:36 +00:00
<description >
2019-06-21 23:04:47 +00:00
Returns the status of the connection. See [enum Status] for values.
2017-09-12 20:42:36 +00:00
</description>
</method>
2018-02-09 14:03:34 +00:00
<method name= "poll" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
2018-02-09 14:03:34 +00:00
<description >
2019-06-21 23:04:47 +00:00
Poll the connection to check for incoming bytes. Call this right before [method StreamPeer.get_available_bytes] for it to work properly.
2018-02-09 14:03:34 +00:00
</description>
</method>
2017-09-12 20:42:36 +00:00
</methods>
2018-07-26 09:56:21 +00:00
<members >
2019-06-29 10:38:01 +00:00
<member name= "blocking_handshake" type= "bool" setter= "set_blocking_handshake_enabled" getter= "is_blocking_handshake_enabled" default= "true" >
2018-07-26 09:56:21 +00:00
</member>
</members>
2017-09-12 20:42:36 +00:00
<constants >
2017-11-24 22:16:30 +00:00
<constant name= "STATUS_DISCONNECTED" value= "0" enum= "Status" >
2019-03-29 22:37:35 +00:00
A status representing a [StreamPeerSSL] that is disconnected.
2017-09-12 20:42:36 +00:00
</constant>
2018-10-07 13:52:07 +00:00
<constant name= "STATUS_HANDSHAKING" value= "1" enum= "Status" >
2020-03-03 18:21:21 +00:00
A status representing a [StreamPeerSSL] during handshaking.
2018-10-07 13:52:07 +00:00
</constant>
2018-07-26 09:56:21 +00:00
<constant name= "STATUS_CONNECTED" value= "2" enum= "Status" >
2019-03-29 22:37:35 +00:00
A status representing a [StreamPeerSSL] that is connected to a host.
2017-09-12 20:42:36 +00:00
</constant>
2018-07-26 09:56:21 +00:00
<constant name= "STATUS_ERROR" value= "3" enum= "Status" >
2020-03-03 18:21:21 +00:00
A status representing a [StreamPeerSSL] in error state.
2017-09-12 20:42:36 +00:00
</constant>
2018-07-26 09:56:21 +00:00
<constant name= "STATUS_ERROR_HOSTNAME_MISMATCH" value= "4" enum= "Status" >
2017-09-12 20:42:36 +00:00
An error status that shows a mismatch in the SSL certificate domain presented by the host and the domain requested for validation.
</constant>
</constants>
</class>