StreamPeerSSL.xml 3.6 KB

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