StreamPeerSSL.xml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="StreamPeerSSL" inherits="StreamPeer" version="4.0">
  3. <brief_description>
  4. SSL stream peer.
  5. </brief_description>
  6. <description>
  7. SSL stream peer. This object can be used to connect to an SSL server or accept a single SSL client connection.
  8. [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.
  9. </description>
  10. <tutorials>
  11. <link title="SSL certificates">https://docs.godotengine.org/en/latest/tutorials/networking/ssl_certificates.html</link>
  12. </tutorials>
  13. <methods>
  14. <method name="accept_stream">
  15. <return type="int" enum="Error" />
  16. <argument index="0" name="stream" type="StreamPeer" />
  17. <argument index="1" name="private_key" type="CryptoKey" />
  18. <argument index="2" name="certificate" type="X509Certificate" />
  19. <argument index="3" name="chain" type="X509Certificate" default="null" />
  20. <description>
  21. 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.
  22. </description>
  23. </method>
  24. <method name="connect_to_stream">
  25. <return type="int" enum="Error" />
  26. <argument index="0" name="stream" type="StreamPeer" />
  27. <argument index="1" name="validate_certs" type="bool" default="false" />
  28. <argument index="2" name="for_hostname" type="String" default="&quot;&quot;" />
  29. <argument index="3" name="valid_certificate" type="X509Certificate" default="null" />
  30. <description>
  31. 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].
  32. [b]Note:[/b] Specifying a custom [code]valid_certificate[/code] is not supported in HTML5 exports due to browsers restrictions.
  33. </description>
  34. </method>
  35. <method name="disconnect_from_stream">
  36. <return type="void" />
  37. <description>
  38. Disconnects from host.
  39. </description>
  40. </method>
  41. <method name="get_status" qualifiers="const">
  42. <return type="int" enum="StreamPeerSSL.Status" />
  43. <description>
  44. Returns the status of the connection. See [enum Status] for values.
  45. </description>
  46. </method>
  47. <method name="poll">
  48. <return type="void" />
  49. <description>
  50. Poll the connection to check for incoming bytes. Call this right before [method StreamPeer.get_available_bytes] for it to work properly.
  51. </description>
  52. </method>
  53. </methods>
  54. <members>
  55. <member name="blocking_handshake" type="bool" setter="set_blocking_handshake_enabled" getter="is_blocking_handshake_enabled" default="true">
  56. </member>
  57. </members>
  58. <constants>
  59. <constant name="STATUS_DISCONNECTED" value="0" enum="Status">
  60. A status representing a [StreamPeerSSL] that is disconnected.
  61. </constant>
  62. <constant name="STATUS_HANDSHAKING" value="1" enum="Status">
  63. A status representing a [StreamPeerSSL] during handshaking.
  64. </constant>
  65. <constant name="STATUS_CONNECTED" value="2" enum="Status">
  66. A status representing a [StreamPeerSSL] that is connected to a host.
  67. </constant>
  68. <constant name="STATUS_ERROR" value="3" enum="Status">
  69. A status representing a [StreamPeerSSL] in error state.
  70. </constant>
  71. <constant name="STATUS_ERROR_HOSTNAME_MISMATCH" value="4" enum="Status">
  72. An error status that shows a mismatch in the SSL certificate domain presented by the host and the domain requested for validation.
  73. </constant>
  74. </constants>
  75. </class>