/
StreamPeerSSL.hx
106 lines (87 loc) · 4.88 KB
/
StreamPeerSSL.hx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
// Automatically generated Godot externs: DO NOT EDIT
// MIT licensed, see LICENSE.md
package godot;
import cs.system.*;
/**
SSL stream peer. This object can be used to connect to an SSL server or accept a single SSL client connection.
**/
@:libType
@:csNative
@:native("Godot.StreamPeerSSL")
@:autoBuild(godot.Godot.buildUserClass())
extern class StreamPeerSSL extends godot.StreamPeer {
@:native("BlockingHandshake")
public var blockingHandshake:Bool;
@:native("new")
public function new():Void;
/**
Poll the connection to check for incoming bytes. Call this right before `godot.StreamPeer.getAvailableBytes` for it to work properly.
**/
@:native("Poll")
public function poll():Void;
#if doc_gen
/**
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.
**/
@:native("AcceptStream")
public function acceptStream(stream:godot.StreamPeer, privateKey:godot.CryptoKey, certificate:godot.X509Certificate, ?chain:godot.X509Certificate):godot.Error;
#else
/**
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.
**/
@:native("AcceptStream")
public overload function acceptStream(stream:godot.StreamPeer, privateKey:godot.CryptoKey, certificate:godot.X509Certificate):godot.Error;
/**
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.
**/
@:native("AcceptStream")
public overload function acceptStream(stream:godot.StreamPeer, privateKey:godot.CryptoKey, certificate:godot.X509Certificate, chain:godot.X509Certificate):godot.Error;
#end
#if doc_gen
/**
Connects to a peer using an underlying `godot.StreamPeer` `stream`. If `validate_certs` is `true`, `godot.StreamPeerSSL` will validate that the certificate presented by the peer matches the `for_hostname`.
Note: Specifying a custom `valid_certificate` is not supported in HTML5 exports due to browsers restrictions.
**/
@:native("ConnectToStream")
public function connectToStream(stream:godot.StreamPeer, ?validateCerts:Bool, ?forHostname:std.String, ?validCertificate:godot.X509Certificate):godot.Error;
#else
/**
Connects to a peer using an underlying `godot.StreamPeer` `stream`. If `validate_certs` is `true`, `godot.StreamPeerSSL` will validate that the certificate presented by the peer matches the `for_hostname`.
Note: Specifying a custom `valid_certificate` is not supported in HTML5 exports due to browsers restrictions.
**/
@:native("ConnectToStream")
public overload function connectToStream(stream:godot.StreamPeer):godot.Error;
/**
Connects to a peer using an underlying `godot.StreamPeer` `stream`. If `validate_certs` is `true`, `godot.StreamPeerSSL` will validate that the certificate presented by the peer matches the `for_hostname`.
Note: Specifying a custom `valid_certificate` is not supported in HTML5 exports due to browsers restrictions.
**/
@:native("ConnectToStream")
public overload function connectToStream(stream:godot.StreamPeer, validateCerts:Bool):godot.Error;
/**
Connects to a peer using an underlying `godot.StreamPeer` `stream`. If `validate_certs` is `true`, `godot.StreamPeerSSL` will validate that the certificate presented by the peer matches the `for_hostname`.
Note: Specifying a custom `valid_certificate` is not supported in HTML5 exports due to browsers restrictions.
**/
@:native("ConnectToStream")
public overload function connectToStream(stream:godot.StreamPeer, validateCerts:Bool, forHostname:std.String):godot.Error;
/**
Connects to a peer using an underlying `godot.StreamPeer` `stream`. If `validate_certs` is `true`, `godot.StreamPeerSSL` will validate that the certificate presented by the peer matches the `for_hostname`.
Note: Specifying a custom `valid_certificate` is not supported in HTML5 exports due to browsers restrictions.
**/
@:native("ConnectToStream")
public overload function connectToStream(stream:godot.StreamPeer, validateCerts:Bool, forHostname:std.String, validCertificate:godot.X509Certificate):godot.Error;
#end
/**
Returns the status of the connection. See `godot.StreamPeerSSL_Status` for values.
**/
@:native("GetStatus")
public function getStatus():godot.StreamPeerSSL_Status;
/**
Disconnects from host.
**/
@:native("DisconnectFromStream")
public function disconnectFromStream():Void;
@:native("SetBlockingHandshakeEnabled")
public function setBlockingHandshakeEnabled(enabled:Bool):Void;
@:native("IsBlockingHandshakeEnabled")
public function isBlockingHandshakeEnabled():Bool;
}