mirror of
https://github.com/godotengine/godot.git
synced 2024-12-09 10:09:20 +08:00
a20cbf2cca
Add documentation for Crypto, CryptoKey, HashingContext, and X509Certificate. Add documentation for `StreamPeerSSL.accept_peer`. Ref #29871.
85 lines
3.3 KiB
XML
85 lines
3.3 KiB
XML
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<class name="StreamPeerSSL" inherits="StreamPeer" category="Core" version="3.2">
|
|
<brief_description>
|
|
SSL stream peer.
|
|
</brief_description>
|
|
<description>
|
|
SSL stream peer. This object can be used to connect to an SSL server or accept a single SSL client connection.
|
|
</description>
|
|
<tutorials>
|
|
<link>https://docs.godotengine.org/en/latest/tutorials/networking/ssl_certificates.html</link>
|
|
</tutorials>
|
|
<methods>
|
|
<method name="accept_stream">
|
|
<return type="int" enum="Error">
|
|
</return>
|
|
<argument index="0" name="stream" type="StreamPeer">
|
|
</argument>
|
|
<argument index="1" name="private_key" type="CryptoKey">
|
|
</argument>
|
|
<argument index="2" name="certificate" type="X509Certificate">
|
|
</argument>
|
|
<argument index="3" name="chain" type="X509Certificate" default="null">
|
|
</argument>
|
|
<description>
|
|
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.
|
|
</description>
|
|
</method>
|
|
<method name="connect_to_stream">
|
|
<return type="int" enum="Error">
|
|
</return>
|
|
<argument index="0" name="stream" type="StreamPeer">
|
|
</argument>
|
|
<argument index="1" name="validate_certs" type="bool" default="false">
|
|
</argument>
|
|
<argument index="2" name="for_hostname" type="String" default="""">
|
|
</argument>
|
|
<argument index="3" name="valid_certificate" type="X509Certificate" default="null">
|
|
</argument>
|
|
<description>
|
|
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].
|
|
</description>
|
|
</method>
|
|
<method name="disconnect_from_stream">
|
|
<return type="void">
|
|
</return>
|
|
<description>
|
|
Disconnects from host.
|
|
</description>
|
|
</method>
|
|
<method name="get_status" qualifiers="const">
|
|
<return type="int" enum="StreamPeerSSL.Status">
|
|
</return>
|
|
<description>
|
|
Returns the status of the connection. See [enum Status] for values.
|
|
</description>
|
|
</method>
|
|
<method name="poll">
|
|
<return type="void">
|
|
</return>
|
|
<description>
|
|
Poll the connection to check for incoming bytes. Call this right before [method StreamPeer.get_available_bytes] for it to work properly.
|
|
</description>
|
|
</method>
|
|
</methods>
|
|
<members>
|
|
<member name="blocking_handshake" type="bool" setter="set_blocking_handshake_enabled" getter="is_blocking_handshake_enabled" default="true">
|
|
</member>
|
|
</members>
|
|
<constants>
|
|
<constant name="STATUS_DISCONNECTED" value="0" enum="Status">
|
|
A status representing a [StreamPeerSSL] that is disconnected.
|
|
</constant>
|
|
<constant name="STATUS_HANDSHAKING" value="1" enum="Status">
|
|
</constant>
|
|
<constant name="STATUS_CONNECTED" value="2" enum="Status">
|
|
A status representing a [StreamPeerSSL] that is connected to a host.
|
|
</constant>
|
|
<constant name="STATUS_ERROR" value="3" enum="Status">
|
|
</constant>
|
|
<constant name="STATUS_ERROR_HOSTNAME_MISMATCH" value="4" enum="Status">
|
|
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>
|