class_streampeerssl.rst 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/StreamPeerSSL.xml.
  6. .. _class_StreamPeerSSL:
  7. StreamPeerSSL
  8. =============
  9. **Inherits:** :ref:`StreamPeer<class_StreamPeer>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  10. SSL stream peer.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. SSL stream peer. This object can be used to connect to an SSL server or accept a single SSL client connection.
  15. .. rst-class:: classref-introduction-group
  16. Tutorials
  17. ---------
  18. - :doc:`../tutorials/networking/ssl_certificates`
  19. .. rst-class:: classref-reftable-group
  20. Properties
  21. ----------
  22. .. table::
  23. :widths: auto
  24. +-------------------------+----------------------------------------------------------------------------+----------+
  25. | :ref:`bool<class_bool>` | :ref:`blocking_handshake<class_StreamPeerSSL_property_blocking_handshake>` | ``true`` |
  26. +-------------------------+----------------------------------------------------------------------------+----------+
  27. .. rst-class:: classref-reftable-group
  28. Methods
  29. -------
  30. .. table::
  31. :widths: auto
  32. +------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`accept_stream<class_StreamPeerSSL_method_accept_stream>` **(** :ref:`StreamPeer<class_StreamPeer>` stream, :ref:`CryptoKey<class_CryptoKey>` private_key, :ref:`X509Certificate<class_X509Certificate>` certificate, :ref:`X509Certificate<class_X509Certificate>` chain=null **)** |
  34. +------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`connect_to_stream<class_StreamPeerSSL_method_connect_to_stream>` **(** :ref:`StreamPeer<class_StreamPeer>` stream, :ref:`bool<class_bool>` validate_certs=false, :ref:`String<class_String>` for_hostname="", :ref:`X509Certificate<class_X509Certificate>` valid_certificate=null **)** |
  36. +------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | void | :ref:`disconnect_from_stream<class_StreamPeerSSL_method_disconnect_from_stream>` **(** **)** |
  38. +------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | :ref:`Status<enum_StreamPeerSSL_Status>` | :ref:`get_status<class_StreamPeerSSL_method_get_status>` **(** **)** |const| |
  40. +------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | void | :ref:`poll<class_StreamPeerSSL_method_poll>` **(** **)** |
  42. +------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. .. rst-class:: classref-section-separator
  44. ----
  45. .. rst-class:: classref-descriptions-group
  46. Enumerations
  47. ------------
  48. .. _enum_StreamPeerSSL_Status:
  49. .. rst-class:: classref-enumeration
  50. enum **Status**:
  51. .. _class_StreamPeerSSL_constant_STATUS_DISCONNECTED:
  52. .. rst-class:: classref-enumeration-constant
  53. :ref:`Status<enum_StreamPeerSSL_Status>` **STATUS_DISCONNECTED** = ``0``
  54. A status representing a **StreamPeerSSL** that is disconnected.
  55. .. _class_StreamPeerSSL_constant_STATUS_HANDSHAKING:
  56. .. rst-class:: classref-enumeration-constant
  57. :ref:`Status<enum_StreamPeerSSL_Status>` **STATUS_HANDSHAKING** = ``1``
  58. A status representing a **StreamPeerSSL** during handshaking.
  59. .. _class_StreamPeerSSL_constant_STATUS_CONNECTED:
  60. .. rst-class:: classref-enumeration-constant
  61. :ref:`Status<enum_StreamPeerSSL_Status>` **STATUS_CONNECTED** = ``2``
  62. A status representing a **StreamPeerSSL** that is connected to a host.
  63. .. _class_StreamPeerSSL_constant_STATUS_ERROR:
  64. .. rst-class:: classref-enumeration-constant
  65. :ref:`Status<enum_StreamPeerSSL_Status>` **STATUS_ERROR** = ``3``
  66. A status representing a **StreamPeerSSL** in error state.
  67. .. _class_StreamPeerSSL_constant_STATUS_ERROR_HOSTNAME_MISMATCH:
  68. .. rst-class:: classref-enumeration-constant
  69. :ref:`Status<enum_StreamPeerSSL_Status>` **STATUS_ERROR_HOSTNAME_MISMATCH** = ``4``
  70. An error status that shows a mismatch in the SSL certificate domain presented by the host and the domain requested for validation.
  71. .. rst-class:: classref-section-separator
  72. ----
  73. .. rst-class:: classref-descriptions-group
  74. Property Descriptions
  75. ---------------------
  76. .. _class_StreamPeerSSL_property_blocking_handshake:
  77. .. rst-class:: classref-property
  78. :ref:`bool<class_bool>` **blocking_handshake** = ``true``
  79. .. rst-class:: classref-property-setget
  80. - void **set_blocking_handshake_enabled** **(** :ref:`bool<class_bool>` value **)**
  81. - :ref:`bool<class_bool>` **is_blocking_handshake_enabled** **(** **)**
  82. .. container:: contribute
  83. There is currently no description for this property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  84. .. rst-class:: classref-section-separator
  85. ----
  86. .. rst-class:: classref-descriptions-group
  87. Method Descriptions
  88. -------------------
  89. .. _class_StreamPeerSSL_method_accept_stream:
  90. .. rst-class:: classref-method
  91. :ref:`Error<enum_@GlobalScope_Error>` **accept_stream** **(** :ref:`StreamPeer<class_StreamPeer>` stream, :ref:`CryptoKey<class_CryptoKey>` private_key, :ref:`X509Certificate<class_X509Certificate>` certificate, :ref:`X509Certificate<class_X509Certificate>` chain=null **)**
  92. Accepts a peer connection as a server using the given ``private_key`` and providing the given ``certificate`` to the client. You can pass the optional ``chain`` parameter to provide additional CA chain information along with the certificate.
  93. .. rst-class:: classref-item-separator
  94. ----
  95. .. _class_StreamPeerSSL_method_connect_to_stream:
  96. .. rst-class:: classref-method
  97. :ref:`Error<enum_@GlobalScope_Error>` **connect_to_stream** **(** :ref:`StreamPeer<class_StreamPeer>` stream, :ref:`bool<class_bool>` validate_certs=false, :ref:`String<class_String>` for_hostname="", :ref:`X509Certificate<class_X509Certificate>` valid_certificate=null **)**
  98. Connects to a peer using an underlying :ref:`StreamPeer<class_StreamPeer>` ``stream``. If ``validate_certs`` is ``true``, **StreamPeerSSL** will validate that the certificate presented by the peer matches the ``for_hostname``.
  99. \ **Note:** Specifying a custom ``valid_certificate`` is not supported in HTML5 exports due to browsers restrictions.
  100. .. rst-class:: classref-item-separator
  101. ----
  102. .. _class_StreamPeerSSL_method_disconnect_from_stream:
  103. .. rst-class:: classref-method
  104. void **disconnect_from_stream** **(** **)**
  105. Disconnects from host.
  106. .. rst-class:: classref-item-separator
  107. ----
  108. .. _class_StreamPeerSSL_method_get_status:
  109. .. rst-class:: classref-method
  110. :ref:`Status<enum_StreamPeerSSL_Status>` **get_status** **(** **)** |const|
  111. Returns the status of the connection. See :ref:`Status<enum_StreamPeerSSL_Status>` for values.
  112. .. rst-class:: classref-item-separator
  113. ----
  114. .. _class_StreamPeerSSL_method_poll:
  115. .. rst-class:: classref-method
  116. void **poll** **(** **)**
  117. Poll the connection to check for incoming bytes. Call this right before :ref:`StreamPeer.get_available_bytes<class_StreamPeer_method_get_available_bytes>` for it to work properly.
  118. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  119. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  120. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  121. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`