-
Notifications
You must be signed in to change notification settings - Fork 35
/
qsslsocket.go
2034 lines (1584 loc) · 89 KB
/
qsslsocket.go
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package qtnetwork
// /usr/include/qt/QtNetwork/qsslsocket.h
// #include <qsslsocket.h>
// #include <QtNetwork>
// header block end
// main block begin
// main block end
// use block begin
// use block end
// ext block begin
/*
#include <stdlib.h>
// extern C begin: 12
*/
// import "C"
import "unsafe"
import "reflect"
import "fmt"
import "log"
import "github.com/kitech/qt.go/qtrt"
import "github.com/kitech/qt.go/qtcore"
// ext block end
// body block begin
// long long readData(char *, qint64)
func (this *QSslSocket) InheritReadData(f func(data string, maxlen int64) int64) {
qtrt.SetAllInheritCallback(this, "readData", f)
}
// long long writeData(const char *, qint64)
func (this *QSslSocket) InheritWriteData(f func(data string, len_ int64) int64) {
qtrt.SetAllInheritCallback(this, "writeData", f)
}
/*
*/
type QSslSocket struct {
*QTcpSocket
}
type QSslSocket_ITF interface {
QTcpSocket_ITF
QSslSocket_PTR() *QSslSocket
}
func (ptr *QSslSocket) QSslSocket_PTR() *QSslSocket { return ptr }
func (this *QSslSocket) GetCthis() unsafe.Pointer {
if this == nil {
return nil
} else {
return this.QTcpSocket.GetCthis()
}
}
func (this *QSslSocket) SetCthis(cthis unsafe.Pointer) {
this.QTcpSocket = NewQTcpSocketFromPointer(cthis)
}
func NewQSslSocketFromPointer(cthis unsafe.Pointer) *QSslSocket {
bcthis0 := NewQTcpSocketFromPointer(cthis)
return &QSslSocket{bcthis0}
}
func (*QSslSocket) NewFromPointer(cthis unsafe.Pointer) *QSslSocket {
return NewQSslSocketFromPointer(cthis)
}
// /usr/include/qt/QtNetwork/qsslsocket.h:67
// index:0
// Public virtual Visibility=Default Availability=Available
// [8] const QMetaObject * metaObject() const
/*
*/
func (this *QSslSocket) MetaObject() *qtcore.QMetaObject /*777 const QMetaObject **/ {
rv, err := qtrt.InvokeQtFunc6("_ZNK10QSslSocket10metaObjectEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
return qtcore.NewQMetaObjectFromPointer(unsafe.Pointer(uintptr(rv))) // 444
}
// /usr/include/qt/QtNetwork/qsslsocket.h:82
// index:0
// Public Visibility=Default Availability=Available
// [-2] void QSslSocket(QObject *)
/*
Constructs a QSslSocket object. parent is passed to QObject's constructor. The new socket's cipher suite is set to the one returned by the static method defaultCiphers().
*/
func (*QSslSocket) NewForInherit(parent qtcore.QObject_ITF /*777 QObject **/) *QSslSocket {
return NewQSslSocket(parent)
}
func NewQSslSocket(parent qtcore.QObject_ITF /*777 QObject **/) *QSslSocket {
var convArg0 unsafe.Pointer
if parent != nil && parent.QObject_PTR() != nil {
convArg0 = parent.QObject_PTR().GetCthis()
}
rv, err := qtrt.InvokeQtFunc6("_ZN10QSslSocketC2EP7QObject", qtrt.FFI_TYPE_POINTER, convArg0)
qtrt.ErrPrint(err, rv)
gothis := NewQSslSocketFromPointer(unsafe.Pointer(uintptr(rv)))
qtrt.ConnectDestroyed(gothis, "QSslSocket")
return gothis
}
// /usr/include/qt/QtNetwork/qsslsocket.h:82
// index:0
// Public Visibility=Default Availability=Available
// [-2] void QSslSocket(QObject *)
/*
Constructs a QSslSocket object. parent is passed to QObject's constructor. The new socket's cipher suite is set to the one returned by the static method defaultCiphers().
*/
func (*QSslSocket) NewForInheritp() *QSslSocket {
return NewQSslSocketp()
}
func NewQSslSocketp() *QSslSocket {
// arg: 0, QObject *=Pointer, QObject=Record, , Invalid
var convArg0 unsafe.Pointer
rv, err := qtrt.InvokeQtFunc6("_ZN10QSslSocketC2EP7QObject", qtrt.FFI_TYPE_POINTER, convArg0)
qtrt.ErrPrint(err, rv)
gothis := NewQSslSocketFromPointer(unsafe.Pointer(uintptr(rv)))
qtrt.ConnectDestroyed(gothis, "QSslSocket")
return gothis
}
// /usr/include/qt/QtNetwork/qsslsocket.h:83
// index:0
// Public virtual Visibility=Default Availability=Available
// [-2] void ~QSslSocket()
/*
*/
func DeleteQSslSocket(this *QSslSocket) {
rv, err := qtrt.InvokeQtFunc6("_ZN10QSslSocketD2Ev", qtrt.FFI_TYPE_VOID, this.GetCthis())
qtrt.Cmemset(this.GetCthis(), 9, 16)
qtrt.ErrPrint(err, rv)
this.SetCthis(nil)
}
// /usr/include/qt/QtNetwork/qsslsocket.h:84
// index:0
// Public virtual Visibility=Default Availability=Available
// [-2] void resume()
/*
Reimplemented from QAbstractSocket::resume().
Continues data transfer on the socket after it has been paused. If "setPauseMode(QAbstractSocket::PauseOnSslErrors);" has been called on this socket and a sslErrors() signal is received, calling this method is necessary for the socket to continue.
This function was introduced in Qt 5.0.
See also QAbstractSocket::pauseMode() and QAbstractSocket::setPauseMode().
*/
func (this *QSslSocket) Resume() {
rv, err := qtrt.InvokeQtFunc6("_ZN10QSslSocket6resumeEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtNetwork/qsslsocket.h:87
// index:0
// Public Visibility=Default Availability=Available
// [-2] void connectToHostEncrypted(const QString &, quint16, QIODevice::OpenMode, QAbstractSocket::NetworkLayerProtocol)
/*
Starts an encrypted connection to the device hostName on port, using mode as the OpenMode. This is equivalent to calling connectToHost() to establish the connection, followed by a call to startClientEncryption(). The protocol parameter can be used to specify which network protocol to use (eg. IPv4 or IPv6).
QSslSocket first enters the HostLookupState. Then, after entering either the event loop or one of the waitFor...() functions, it enters the ConnectingState, emits connected(), and then initiates the SSL client handshake. At each state change, QSslSocket emits signal stateChanged().
After initiating the SSL client handshake, if the identity of the peer can't be established, signal sslErrors() is emitted. If you want to ignore the errors and continue connecting, you must call ignoreSslErrors(), either from inside a slot function connected to the sslErrors() signal, or prior to entering encrypted mode. If ignoreSslErrors() is not called, the connection is dropped, signal disconnected() is emitted, and QSslSocket returns to the UnconnectedState.
If the SSL handshake is successful, QSslSocket emits encrypted().
QSslSocket socket;
connect(&socket, SIGNAL(encrypted()), receiver, SLOT(socketEncrypted()));
socket.connectToHostEncrypted("imap", 993);
socket->write("1 CAPABILITY\r\n");
Note: The example above shows that text can be written to the socket immediately after requesting the encrypted connection, before the encrypted() signal has been emitted. In such cases, the text is queued in the object and written to the socket after the connection is established and the encrypted() signal has been emitted.
The default for mode is ReadWrite.
If you want to create a QSslSocket on the server side of a connection, you should instead call startServerEncryption() upon receiving the incoming connection through QTcpServer.
See also connectToHost(), startClientEncryption(), waitForConnected(), and waitForEncrypted().
*/
func (this *QSslSocket) ConnectToHostEncrypted(hostName string, port uint16, mode int, protocol int) {
var tmpArg0 = qtcore.NewQString5(hostName)
var convArg0 = tmpArg0.GetCthis()
rv, err := qtrt.InvokeQtFunc6("_ZN10QSslSocket22connectToHostEncryptedERK7QStringt6QFlagsIN9QIODevice12OpenModeFlagEEN15QAbstractSocket20NetworkLayerProtocolE", qtrt.FFI_TYPE_POINTER, this.GetCthis(), convArg0, port, mode, protocol)
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtNetwork/qsslsocket.h:87
// index:0
// Public Visibility=Default Availability=Available
// [-2] void connectToHostEncrypted(const QString &, quint16, QIODevice::OpenMode, QAbstractSocket::NetworkLayerProtocol)
/*
Starts an encrypted connection to the device hostName on port, using mode as the OpenMode. This is equivalent to calling connectToHost() to establish the connection, followed by a call to startClientEncryption(). The protocol parameter can be used to specify which network protocol to use (eg. IPv4 or IPv6).
QSslSocket first enters the HostLookupState. Then, after entering either the event loop or one of the waitFor...() functions, it enters the ConnectingState, emits connected(), and then initiates the SSL client handshake. At each state change, QSslSocket emits signal stateChanged().
After initiating the SSL client handshake, if the identity of the peer can't be established, signal sslErrors() is emitted. If you want to ignore the errors and continue connecting, you must call ignoreSslErrors(), either from inside a slot function connected to the sslErrors() signal, or prior to entering encrypted mode. If ignoreSslErrors() is not called, the connection is dropped, signal disconnected() is emitted, and QSslSocket returns to the UnconnectedState.
If the SSL handshake is successful, QSslSocket emits encrypted().
QSslSocket socket;
connect(&socket, SIGNAL(encrypted()), receiver, SLOT(socketEncrypted()));
socket.connectToHostEncrypted("imap", 993);
socket->write("1 CAPABILITY\r\n");
Note: The example above shows that text can be written to the socket immediately after requesting the encrypted connection, before the encrypted() signal has been emitted. In such cases, the text is queued in the object and written to the socket after the connection is established and the encrypted() signal has been emitted.
The default for mode is ReadWrite.
If you want to create a QSslSocket on the server side of a connection, you should instead call startServerEncryption() upon receiving the incoming connection through QTcpServer.
See also connectToHost(), startClientEncryption(), waitForConnected(), and waitForEncrypted().
*/
func (this *QSslSocket) ConnectToHostEncryptedp(hostName string, port uint16) {
var tmpArg0 = qtcore.NewQString5(hostName)
var convArg0 = tmpArg0.GetCthis()
// arg: 2, QIODevice::OpenMode=Typedef, QIODevice::OpenMode=Typedef, QFlags<QIODevice::OpenModeFlag>, Unexposed
mode := 0
// arg: 3, QAbstractSocket::NetworkLayerProtocol=Enum, QAbstractSocket::NetworkLayerProtocol=Enum, , Invalid
protocol := 0
rv, err := qtrt.InvokeQtFunc6("_ZN10QSslSocket22connectToHostEncryptedERK7QStringt6QFlagsIN9QIODevice12OpenModeFlagEEN15QAbstractSocket20NetworkLayerProtocolE", qtrt.FFI_TYPE_POINTER, this.GetCthis(), convArg0, port, mode, protocol)
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtNetwork/qsslsocket.h:87
// index:0
// Public Visibility=Default Availability=Available
// [-2] void connectToHostEncrypted(const QString &, quint16, QIODevice::OpenMode, QAbstractSocket::NetworkLayerProtocol)
/*
Starts an encrypted connection to the device hostName on port, using mode as the OpenMode. This is equivalent to calling connectToHost() to establish the connection, followed by a call to startClientEncryption(). The protocol parameter can be used to specify which network protocol to use (eg. IPv4 or IPv6).
QSslSocket first enters the HostLookupState. Then, after entering either the event loop or one of the waitFor...() functions, it enters the ConnectingState, emits connected(), and then initiates the SSL client handshake. At each state change, QSslSocket emits signal stateChanged().
After initiating the SSL client handshake, if the identity of the peer can't be established, signal sslErrors() is emitted. If you want to ignore the errors and continue connecting, you must call ignoreSslErrors(), either from inside a slot function connected to the sslErrors() signal, or prior to entering encrypted mode. If ignoreSslErrors() is not called, the connection is dropped, signal disconnected() is emitted, and QSslSocket returns to the UnconnectedState.
If the SSL handshake is successful, QSslSocket emits encrypted().
QSslSocket socket;
connect(&socket, SIGNAL(encrypted()), receiver, SLOT(socketEncrypted()));
socket.connectToHostEncrypted("imap", 993);
socket->write("1 CAPABILITY\r\n");
Note: The example above shows that text can be written to the socket immediately after requesting the encrypted connection, before the encrypted() signal has been emitted. In such cases, the text is queued in the object and written to the socket after the connection is established and the encrypted() signal has been emitted.
The default for mode is ReadWrite.
If you want to create a QSslSocket on the server side of a connection, you should instead call startServerEncryption() upon receiving the incoming connection through QTcpServer.
See also connectToHost(), startClientEncryption(), waitForConnected(), and waitForEncrypted().
*/
func (this *QSslSocket) ConnectToHostEncryptedp1(hostName string, port uint16, mode int) {
var tmpArg0 = qtcore.NewQString5(hostName)
var convArg0 = tmpArg0.GetCthis()
// arg: 3, QAbstractSocket::NetworkLayerProtocol=Enum, QAbstractSocket::NetworkLayerProtocol=Enum, , Invalid
protocol := 0
rv, err := qtrt.InvokeQtFunc6("_ZN10QSslSocket22connectToHostEncryptedERK7QStringt6QFlagsIN9QIODevice12OpenModeFlagEEN15QAbstractSocket20NetworkLayerProtocolE", qtrt.FFI_TYPE_POINTER, this.GetCthis(), convArg0, port, mode, protocol)
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtNetwork/qsslsocket.h:88
// index:1
// Public Visibility=Default Availability=Available
// [-2] void connectToHostEncrypted(const QString &, quint16, const QString &, QIODevice::OpenMode, QAbstractSocket::NetworkLayerProtocol)
/*
Starts an encrypted connection to the device hostName on port, using mode as the OpenMode. This is equivalent to calling connectToHost() to establish the connection, followed by a call to startClientEncryption(). The protocol parameter can be used to specify which network protocol to use (eg. IPv4 or IPv6).
QSslSocket first enters the HostLookupState. Then, after entering either the event loop or one of the waitFor...() functions, it enters the ConnectingState, emits connected(), and then initiates the SSL client handshake. At each state change, QSslSocket emits signal stateChanged().
After initiating the SSL client handshake, if the identity of the peer can't be established, signal sslErrors() is emitted. If you want to ignore the errors and continue connecting, you must call ignoreSslErrors(), either from inside a slot function connected to the sslErrors() signal, or prior to entering encrypted mode. If ignoreSslErrors() is not called, the connection is dropped, signal disconnected() is emitted, and QSslSocket returns to the UnconnectedState.
If the SSL handshake is successful, QSslSocket emits encrypted().
QSslSocket socket;
connect(&socket, SIGNAL(encrypted()), receiver, SLOT(socketEncrypted()));
socket.connectToHostEncrypted("imap", 993);
socket->write("1 CAPABILITY\r\n");
Note: The example above shows that text can be written to the socket immediately after requesting the encrypted connection, before the encrypted() signal has been emitted. In such cases, the text is queued in the object and written to the socket after the connection is established and the encrypted() signal has been emitted.
The default for mode is ReadWrite.
If you want to create a QSslSocket on the server side of a connection, you should instead call startServerEncryption() upon receiving the incoming connection through QTcpServer.
See also connectToHost(), startClientEncryption(), waitForConnected(), and waitForEncrypted().
*/
func (this *QSslSocket) ConnectToHostEncrypted1(hostName string, port uint16, sslPeerName string, mode int, protocol int) {
var tmpArg0 = qtcore.NewQString5(hostName)
var convArg0 = tmpArg0.GetCthis()
var tmpArg2 = qtcore.NewQString5(sslPeerName)
var convArg2 = tmpArg2.GetCthis()
rv, err := qtrt.InvokeQtFunc6("_ZN10QSslSocket22connectToHostEncryptedERK7QStringtS2_6QFlagsIN9QIODevice12OpenModeFlagEEN15QAbstractSocket20NetworkLayerProtocolE", qtrt.FFI_TYPE_POINTER, this.GetCthis(), convArg0, port, convArg2, mode, protocol)
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtNetwork/qsslsocket.h:88
// index:1
// Public Visibility=Default Availability=Available
// [-2] void connectToHostEncrypted(const QString &, quint16, const QString &, QIODevice::OpenMode, QAbstractSocket::NetworkLayerProtocol)
/*
Starts an encrypted connection to the device hostName on port, using mode as the OpenMode. This is equivalent to calling connectToHost() to establish the connection, followed by a call to startClientEncryption(). The protocol parameter can be used to specify which network protocol to use (eg. IPv4 or IPv6).
QSslSocket first enters the HostLookupState. Then, after entering either the event loop or one of the waitFor...() functions, it enters the ConnectingState, emits connected(), and then initiates the SSL client handshake. At each state change, QSslSocket emits signal stateChanged().
After initiating the SSL client handshake, if the identity of the peer can't be established, signal sslErrors() is emitted. If you want to ignore the errors and continue connecting, you must call ignoreSslErrors(), either from inside a slot function connected to the sslErrors() signal, or prior to entering encrypted mode. If ignoreSslErrors() is not called, the connection is dropped, signal disconnected() is emitted, and QSslSocket returns to the UnconnectedState.
If the SSL handshake is successful, QSslSocket emits encrypted().
QSslSocket socket;
connect(&socket, SIGNAL(encrypted()), receiver, SLOT(socketEncrypted()));
socket.connectToHostEncrypted("imap", 993);
socket->write("1 CAPABILITY\r\n");
Note: The example above shows that text can be written to the socket immediately after requesting the encrypted connection, before the encrypted() signal has been emitted. In such cases, the text is queued in the object and written to the socket after the connection is established and the encrypted() signal has been emitted.
The default for mode is ReadWrite.
If you want to create a QSslSocket on the server side of a connection, you should instead call startServerEncryption() upon receiving the incoming connection through QTcpServer.
See also connectToHost(), startClientEncryption(), waitForConnected(), and waitForEncrypted().
*/
func (this *QSslSocket) ConnectToHostEncrypted1p(hostName string, port uint16, sslPeerName string) {
var tmpArg0 = qtcore.NewQString5(hostName)
var convArg0 = tmpArg0.GetCthis()
var tmpArg2 = qtcore.NewQString5(sslPeerName)
var convArg2 = tmpArg2.GetCthis()
// arg: 3, QIODevice::OpenMode=Typedef, QIODevice::OpenMode=Typedef, QFlags<QIODevice::OpenModeFlag>, Unexposed
mode := 0
// arg: 4, QAbstractSocket::NetworkLayerProtocol=Enum, QAbstractSocket::NetworkLayerProtocol=Enum, , Invalid
protocol := 0
rv, err := qtrt.InvokeQtFunc6("_ZN10QSslSocket22connectToHostEncryptedERK7QStringtS2_6QFlagsIN9QIODevice12OpenModeFlagEEN15QAbstractSocket20NetworkLayerProtocolE", qtrt.FFI_TYPE_POINTER, this.GetCthis(), convArg0, port, convArg2, mode, protocol)
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtNetwork/qsslsocket.h:88
// index:1
// Public Visibility=Default Availability=Available
// [-2] void connectToHostEncrypted(const QString &, quint16, const QString &, QIODevice::OpenMode, QAbstractSocket::NetworkLayerProtocol)
/*
Starts an encrypted connection to the device hostName on port, using mode as the OpenMode. This is equivalent to calling connectToHost() to establish the connection, followed by a call to startClientEncryption(). The protocol parameter can be used to specify which network protocol to use (eg. IPv4 or IPv6).
QSslSocket first enters the HostLookupState. Then, after entering either the event loop or one of the waitFor...() functions, it enters the ConnectingState, emits connected(), and then initiates the SSL client handshake. At each state change, QSslSocket emits signal stateChanged().
After initiating the SSL client handshake, if the identity of the peer can't be established, signal sslErrors() is emitted. If you want to ignore the errors and continue connecting, you must call ignoreSslErrors(), either from inside a slot function connected to the sslErrors() signal, or prior to entering encrypted mode. If ignoreSslErrors() is not called, the connection is dropped, signal disconnected() is emitted, and QSslSocket returns to the UnconnectedState.
If the SSL handshake is successful, QSslSocket emits encrypted().
QSslSocket socket;
connect(&socket, SIGNAL(encrypted()), receiver, SLOT(socketEncrypted()));
socket.connectToHostEncrypted("imap", 993);
socket->write("1 CAPABILITY\r\n");
Note: The example above shows that text can be written to the socket immediately after requesting the encrypted connection, before the encrypted() signal has been emitted. In such cases, the text is queued in the object and written to the socket after the connection is established and the encrypted() signal has been emitted.
The default for mode is ReadWrite.
If you want to create a QSslSocket on the server side of a connection, you should instead call startServerEncryption() upon receiving the incoming connection through QTcpServer.
See also connectToHost(), startClientEncryption(), waitForConnected(), and waitForEncrypted().
*/
func (this *QSslSocket) ConnectToHostEncrypted1p1(hostName string, port uint16, sslPeerName string, mode int) {
var tmpArg0 = qtcore.NewQString5(hostName)
var convArg0 = tmpArg0.GetCthis()
var tmpArg2 = qtcore.NewQString5(sslPeerName)
var convArg2 = tmpArg2.GetCthis()
// arg: 4, QAbstractSocket::NetworkLayerProtocol=Enum, QAbstractSocket::NetworkLayerProtocol=Enum, , Invalid
protocol := 0
rv, err := qtrt.InvokeQtFunc6("_ZN10QSslSocket22connectToHostEncryptedERK7QStringtS2_6QFlagsIN9QIODevice12OpenModeFlagEEN15QAbstractSocket20NetworkLayerProtocolE", qtrt.FFI_TYPE_POINTER, this.GetCthis(), convArg0, port, convArg2, mode, protocol)
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtNetwork/qsslsocket.h:89
// index:0
// Public virtual Visibility=Default Availability=Available
// [1] bool setSocketDescriptor(qintptr, QAbstractSocket::SocketState, QIODevice::OpenMode)
/*
Reimplemented from QAbstractSocket::setSocketDescriptor().
Initializes QSslSocket with the native socket descriptor socketDescriptor. Returns true if socketDescriptor is accepted as a valid socket descriptor; otherwise returns false. The socket is opened in the mode specified by openMode, and enters the socket state specified by state.
Note: It is not possible to initialize two sockets with the same native socket descriptor.
See also socketDescriptor().
*/
func (this *QSslSocket) SetSocketDescriptor(socketDescriptor int64, state int, openMode int) bool {
rv, err := qtrt.InvokeQtFunc6("_ZN10QSslSocket19setSocketDescriptorExN15QAbstractSocket11SocketStateE6QFlagsIN9QIODevice12OpenModeFlagEE", qtrt.FFI_TYPE_POINTER, this.GetCthis(), socketDescriptor, state, openMode)
qtrt.ErrPrint(err, rv)
return rv != 0
}
// /usr/include/qt/QtNetwork/qsslsocket.h:89
// index:0
// Public virtual Visibility=Default Availability=Available
// [1] bool setSocketDescriptor(qintptr, QAbstractSocket::SocketState, QIODevice::OpenMode)
/*
Reimplemented from QAbstractSocket::setSocketDescriptor().
Initializes QSslSocket with the native socket descriptor socketDescriptor. Returns true if socketDescriptor is accepted as a valid socket descriptor; otherwise returns false. The socket is opened in the mode specified by openMode, and enters the socket state specified by state.
Note: It is not possible to initialize two sockets with the same native socket descriptor.
See also socketDescriptor().
*/
func (this *QSslSocket) SetSocketDescriptorp(socketDescriptor int64) bool {
// arg: 1, QAbstractSocket::SocketState=Enum, QAbstractSocket::SocketState=Enum, , Invalid
state := 0
// arg: 2, QIODevice::OpenMode=Typedef, QIODevice::OpenMode=Typedef, QFlags<QIODevice::OpenModeFlag>, Unexposed
openMode := 0
rv, err := qtrt.InvokeQtFunc6("_ZN10QSslSocket19setSocketDescriptorExN15QAbstractSocket11SocketStateE6QFlagsIN9QIODevice12OpenModeFlagEE", qtrt.FFI_TYPE_POINTER, this.GetCthis(), socketDescriptor, state, openMode)
qtrt.ErrPrint(err, rv)
return rv != 0
}
// /usr/include/qt/QtNetwork/qsslsocket.h:89
// index:0
// Public virtual Visibility=Default Availability=Available
// [1] bool setSocketDescriptor(qintptr, QAbstractSocket::SocketState, QIODevice::OpenMode)
/*
Reimplemented from QAbstractSocket::setSocketDescriptor().
Initializes QSslSocket with the native socket descriptor socketDescriptor. Returns true if socketDescriptor is accepted as a valid socket descriptor; otherwise returns false. The socket is opened in the mode specified by openMode, and enters the socket state specified by state.
Note: It is not possible to initialize two sockets with the same native socket descriptor.
See also socketDescriptor().
*/
func (this *QSslSocket) SetSocketDescriptorp1(socketDescriptor int64, state int) bool {
// arg: 2, QIODevice::OpenMode=Typedef, QIODevice::OpenMode=Typedef, QFlags<QIODevice::OpenModeFlag>, Unexposed
openMode := 0
rv, err := qtrt.InvokeQtFunc6("_ZN10QSslSocket19setSocketDescriptorExN15QAbstractSocket11SocketStateE6QFlagsIN9QIODevice12OpenModeFlagEE", qtrt.FFI_TYPE_POINTER, this.GetCthis(), socketDescriptor, state, openMode)
qtrt.ErrPrint(err, rv)
return rv != 0
}
// /usr/include/qt/QtNetwork/qsslsocket.h:93
// index:0
// Public virtual Visibility=Default Availability=Available
// [-2] void connectToHost(const QString &, quint16, QIODevice::OpenMode, QAbstractSocket::NetworkLayerProtocol)
/*
*/
func (this *QSslSocket) ConnectToHost(hostName string, port uint16, openMode int, protocol int) {
var tmpArg0 = qtcore.NewQString5(hostName)
var convArg0 = tmpArg0.GetCthis()
rv, err := qtrt.InvokeQtFunc6("_ZN10QSslSocket13connectToHostERK7QStringt6QFlagsIN9QIODevice12OpenModeFlagEEN15QAbstractSocket20NetworkLayerProtocolE", qtrt.FFI_TYPE_POINTER, this.GetCthis(), convArg0, port, openMode, protocol)
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtNetwork/qsslsocket.h:93
// index:0
// Public virtual Visibility=Default Availability=Available
// [-2] void connectToHost(const QString &, quint16, QIODevice::OpenMode, QAbstractSocket::NetworkLayerProtocol)
/*
*/
func (this *QSslSocket) ConnectToHostp(hostName string, port uint16) {
var tmpArg0 = qtcore.NewQString5(hostName)
var convArg0 = tmpArg0.GetCthis()
// arg: 2, QIODevice::OpenMode=Typedef, QIODevice::OpenMode=Typedef, QFlags<QIODevice::OpenModeFlag>, Unexposed
openMode := 0
// arg: 3, QAbstractSocket::NetworkLayerProtocol=Enum, QAbstractSocket::NetworkLayerProtocol=Enum, , Invalid
protocol := 0
rv, err := qtrt.InvokeQtFunc6("_ZN10QSslSocket13connectToHostERK7QStringt6QFlagsIN9QIODevice12OpenModeFlagEEN15QAbstractSocket20NetworkLayerProtocolE", qtrt.FFI_TYPE_POINTER, this.GetCthis(), convArg0, port, openMode, protocol)
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtNetwork/qsslsocket.h:93
// index:0
// Public virtual Visibility=Default Availability=Available
// [-2] void connectToHost(const QString &, quint16, QIODevice::OpenMode, QAbstractSocket::NetworkLayerProtocol)
/*
*/
func (this *QSslSocket) ConnectToHostp1(hostName string, port uint16, openMode int) {
var tmpArg0 = qtcore.NewQString5(hostName)
var convArg0 = tmpArg0.GetCthis()
// arg: 3, QAbstractSocket::NetworkLayerProtocol=Enum, QAbstractSocket::NetworkLayerProtocol=Enum, , Invalid
protocol := 0
rv, err := qtrt.InvokeQtFunc6("_ZN10QSslSocket13connectToHostERK7QStringt6QFlagsIN9QIODevice12OpenModeFlagEEN15QAbstractSocket20NetworkLayerProtocolE", qtrt.FFI_TYPE_POINTER, this.GetCthis(), convArg0, port, openMode, protocol)
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtNetwork/qsslsocket.h:94
// index:0
// Public virtual Visibility=Default Availability=Available
// [-2] void disconnectFromHost()
/*
*/
func (this *QSslSocket) DisconnectFromHost() {
rv, err := qtrt.InvokeQtFunc6("_ZN10QSslSocket18disconnectFromHostEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtNetwork/qsslsocket.h:96
// index:0
// Public virtual Visibility=Default Availability=Available
// [-2] void setSocketOption(QAbstractSocket::SocketOption, const QVariant &)
/*
Reimplemented from QAbstractSocket::setSocketOption().
Sets the given option to the value described by value.
This function was introduced in Qt 4.6.
See also socketOption().
*/
func (this *QSslSocket) SetSocketOption(option int, value qtcore.QVariant_ITF) {
var convArg1 unsafe.Pointer
if value != nil && value.QVariant_PTR() != nil {
convArg1 = value.QVariant_PTR().GetCthis()
}
rv, err := qtrt.InvokeQtFunc6("_ZN10QSslSocket15setSocketOptionEN15QAbstractSocket12SocketOptionERK8QVariant", qtrt.FFI_TYPE_POINTER, this.GetCthis(), option, convArg1)
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtNetwork/qsslsocket.h:97
// index:0
// Public virtual Visibility=Default Availability=Available
// [16] QVariant socketOption(QAbstractSocket::SocketOption)
/*
Reimplemented from QAbstractSocket::socketOption().
Returns the value of the option option.
This function was introduced in Qt 4.6.
See also setSocketOption().
*/
func (this *QSslSocket) SocketOption(option int) *qtcore.QVariant /*123*/ {
rv, err := qtrt.InvokeQtFunc6("_ZN10QSslSocket12socketOptionEN15QAbstractSocket12SocketOptionE", qtrt.FFI_TYPE_POINTER, this.GetCthis(), option)
qtrt.ErrPrint(err, rv)
rv2 := qtcore.NewQVariantFromPointer(unsafe.Pointer(uintptr(rv))) // 333
qtrt.SetFinalizer(rv2, qtcore.DeleteQVariant)
return rv2
}
// /usr/include/qt/QtNetwork/qsslsocket.h:99
// index:0
// Public Visibility=Default Availability=Available
// [4] QSslSocket::SslMode mode() const
/*
Returns the current mode for the socket; either UnencryptedMode, where QSslSocket behaves identially to QTcpSocket, or one of SslClientMode or SslServerMode, where the client is either negotiating or in encrypted mode.
When the mode changes, QSslSocket emits modeChanged()
See also SslMode.
*/
func (this *QSslSocket) Mode() int {
rv, err := qtrt.InvokeQtFunc6("_ZNK10QSslSocket4modeEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
return int(rv)
}
// /usr/include/qt/QtNetwork/qsslsocket.h:100
// index:0
// Public Visibility=Default Availability=Available
// [1] bool isEncrypted() const
/*
Returns true if the socket is encrypted; otherwise, false is returned.
An encrypted socket encrypts all data that is written by calling write() or putChar() before the data is written to the network, and decrypts all incoming data as the data is received from the network, before you call read(), readLine() or getChar().
QSslSocket emits encrypted() when it enters encrypted mode.
You can call sessionCipher() to find which cryptographic cipher is used to encrypt and decrypt your data.
See also mode().
*/
func (this *QSslSocket) IsEncrypted() bool {
rv, err := qtrt.InvokeQtFunc6("_ZNK10QSslSocket11isEncryptedEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
return rv != 0
}
// /usr/include/qt/QtNetwork/qsslsocket.h:102
// index:0
// Public Visibility=Default Availability=Available
// [4] QSsl::SslProtocol protocol() const
/*
Returns the socket's SSL protocol. By default, QSsl::SecureProtocols is used.
See also setProtocol().
*/
func (this *QSslSocket) Protocol() int {
rv, err := qtrt.InvokeQtFunc6("_ZNK10QSslSocket8protocolEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
return int(rv)
}
// /usr/include/qt/QtNetwork/qsslsocket.h:103
// index:0
// Public Visibility=Default Availability=Available
// [-2] void setProtocol(QSsl::SslProtocol)
/*
Sets the socket's SSL protocol to protocol. This will affect the next initiated handshake; calling this function on an already-encrypted socket will not affect the socket's protocol.
See also protocol().
*/
func (this *QSslSocket) SetProtocol(protocol int) {
rv, err := qtrt.InvokeQtFunc6("_ZN10QSslSocket11setProtocolEN4QSsl11SslProtocolE", qtrt.FFI_TYPE_POINTER, this.GetCthis(), protocol)
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtNetwork/qsslsocket.h:105
// index:0
// Public Visibility=Default Availability=Available
// [4] QSslSocket::PeerVerifyMode peerVerifyMode() const
/*
Returns the socket's verify mode. This mode decides whether QSslSocket should request a certificate from the peer (i.e., the client requests a certificate from the server, or a server requesting a certificate from the client), and whether it should require that this certificate is valid.
The default mode is AutoVerifyPeer, which tells QSslSocket to use VerifyPeer for clients and QueryPeer for servers.
This function was introduced in Qt 4.4.
See also setPeerVerifyMode(), peerVerifyDepth(), and mode().
*/
func (this *QSslSocket) PeerVerifyMode() int {
rv, err := qtrt.InvokeQtFunc6("_ZNK10QSslSocket14peerVerifyModeEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
return int(rv)
}
// /usr/include/qt/QtNetwork/qsslsocket.h:106
// index:0
// Public Visibility=Default Availability=Available
// [-2] void setPeerVerifyMode(QSslSocket::PeerVerifyMode)
/*
Sets the socket's verify mode to mode. This mode decides whether QSslSocket should request a certificate from the peer (i.e., the client requests a certificate from the server, or a server requesting a certificate from the client), and whether it should require that this certificate is valid.
The default mode is AutoVerifyPeer, which tells QSslSocket to use VerifyPeer for clients and QueryPeer for servers.
Setting this mode after encryption has started has no effect on the current connection.
This function was introduced in Qt 4.4.
See also peerVerifyMode(), setPeerVerifyDepth(), and mode().
*/
func (this *QSslSocket) SetPeerVerifyMode(mode int) {
rv, err := qtrt.InvokeQtFunc6("_ZN10QSslSocket17setPeerVerifyModeENS_14PeerVerifyModeE", qtrt.FFI_TYPE_POINTER, this.GetCthis(), mode)
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtNetwork/qsslsocket.h:108
// index:0
// Public Visibility=Default Availability=Available
// [4] int peerVerifyDepth() const
/*
Returns the maximum number of certificates in the peer's certificate chain to be checked during the SSL handshake phase, or 0 (the default) if no maximum depth has been set, indicating that the whole certificate chain should be checked.
The certificates are checked in issuing order, starting with the peer's own certificate, then its issuer's certificate, and so on.
This function was introduced in Qt 4.4.
See also setPeerVerifyDepth() and peerVerifyMode().
*/
func (this *QSslSocket) PeerVerifyDepth() int {
rv, err := qtrt.InvokeQtFunc6("_ZNK10QSslSocket15peerVerifyDepthEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
return qtrt.Cretval2go("int", rv).(int) // 1111
}
// /usr/include/qt/QtNetwork/qsslsocket.h:109
// index:0
// Public Visibility=Default Availability=Available
// [-2] void setPeerVerifyDepth(int)
/*
Sets the maximum number of certificates in the peer's certificate chain to be checked during the SSL handshake phase, to depth. Setting a depth of 0 means that no maximum depth is set, indicating that the whole certificate chain should be checked.
The certificates are checked in issuing order, starting with the peer's own certificate, then its issuer's certificate, and so on.
This function was introduced in Qt 4.4.
See also peerVerifyDepth() and setPeerVerifyMode().
*/
func (this *QSslSocket) SetPeerVerifyDepth(depth int) {
rv, err := qtrt.InvokeQtFunc6("_ZN10QSslSocket18setPeerVerifyDepthEi", qtrt.FFI_TYPE_POINTER, this.GetCthis(), depth)
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtNetwork/qsslsocket.h:111
// index:0
// Public Visibility=Default Availability=Available
// [8] QString peerVerifyName() const
/*
Returns the different hostname for the certificate validation, as set by setPeerVerifyName or by connectToHostEncrypted.
This function was introduced in Qt 4.8.
See also setPeerVerifyName() and connectToHostEncrypted().
*/
func (this *QSslSocket) PeerVerifyName() string {
rv, err := qtrt.InvokeQtFunc6("_ZNK10QSslSocket14peerVerifyNameEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
rv2 := qtcore.NewQStringFromPointer(unsafe.Pointer(uintptr(rv)))
rv3 := rv2.ToUtf8().Data()
qtcore.DeleteQString(rv2)
return rv3
}
// /usr/include/qt/QtNetwork/qsslsocket.h:112
// index:0
// Public Visibility=Default Availability=Available
// [-2] void setPeerVerifyName(const QString &)
/*
Sets a different host name, given by hostName, for the certificate validation instead of the one used for the TCP connection.
This function was introduced in Qt 4.8.
See also peerVerifyName() and connectToHostEncrypted().
*/
func (this *QSslSocket) SetPeerVerifyName(hostName string) {
var tmpArg0 = qtcore.NewQString5(hostName)
var convArg0 = tmpArg0.GetCthis()
rv, err := qtrt.InvokeQtFunc6("_ZN10QSslSocket17setPeerVerifyNameERK7QString", qtrt.FFI_TYPE_POINTER, this.GetCthis(), convArg0)
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtNetwork/qsslsocket.h:115
// index:0
// Public virtual Visibility=Default Availability=Available
// [8] qint64 bytesAvailable() const
/*
Reimplemented from QAbstractSocket::bytesAvailable().
Returns the number of decrypted bytes that are immediately available for reading.
*/
func (this *QSslSocket) BytesAvailable() int64 {
rv, err := qtrt.InvokeQtFunc6("_ZNK10QSslSocket14bytesAvailableEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
return int64(rv) // 222
}
// /usr/include/qt/QtNetwork/qsslsocket.h:116
// index:0
// Public virtual Visibility=Default Availability=Available
// [8] qint64 bytesToWrite() const
/*
Reimplemented from QAbstractSocket::bytesToWrite().
Returns the number of unencrypted bytes that are waiting to be encrypted and written to the network.
*/
func (this *QSslSocket) BytesToWrite() int64 {
rv, err := qtrt.InvokeQtFunc6("_ZNK10QSslSocket12bytesToWriteEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
return int64(rv) // 222
}
// /usr/include/qt/QtNetwork/qsslsocket.h:117
// index:0
// Public virtual Visibility=Default Availability=Available
// [1] bool canReadLine() const
/*
Reimplemented from QAbstractSocket::canReadLine().
Returns true if you can read one while line (terminated by a single ASCII '\n' character) of decrypted characters; otherwise, false is returned.
*/
func (this *QSslSocket) CanReadLine() bool {
rv, err := qtrt.InvokeQtFunc6("_ZNK10QSslSocket11canReadLineEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
return rv != 0
}
// /usr/include/qt/QtNetwork/qsslsocket.h:118
// index:0
// Public virtual Visibility=Default Availability=Available
// [-2] void close()
/*
Reimplemented from QAbstractSocket::close().
*/
func (this *QSslSocket) Close() {
rv, err := qtrt.InvokeQtFunc6("_ZN10QSslSocket5closeEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtNetwork/qsslsocket.h:119
// index:0
// Public virtual Visibility=Default Availability=Available
// [1] bool atEnd() const
/*
Reimplemented from QAbstractSocket::atEnd().
*/
func (this *QSslSocket) AtEnd() bool {
rv, err := qtrt.InvokeQtFunc6("_ZNK10QSslSocket5atEndEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
return rv != 0
}
// /usr/include/qt/QtNetwork/qsslsocket.h:120
// index:0
// Public Visibility=Default Availability=Available
// [1] bool flush()
/*
This function writes as much as possible from the internal write buffer to the underlying network socket, without blocking. If any data was written, this function returns true; otherwise false is returned.
Call this function if you need QSslSocket to start sending buffered data immediately. The number of bytes successfully written depends on the operating system. In most cases, you do not need to call this function, because QAbstractSocket will start sending data automatically once control goes back to the event loop. In the absence of an event loop, call waitForBytesWritten() instead.
See also write() and waitForBytesWritten().
*/
func (this *QSslSocket) Flush() bool {
rv, err := qtrt.InvokeQtFunc6("_ZN10QSslSocket5flushEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
return rv != 0
}
// /usr/include/qt/QtNetwork/qsslsocket.h:121
// index:0
// Public Visibility=Default Availability=Available
// [-2] void abort()
/*
Aborts the current connection and resets the socket. Unlike disconnectFromHost(), this function immediately closes the socket, clearing any pending data in the write buffer.
See also disconnectFromHost() and close().
*/
func (this *QSslSocket) Abort() {
rv, err := qtrt.InvokeQtFunc6("_ZN10QSslSocket5abortEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtNetwork/qsslsocket.h:124
// index:0
// Public virtual Visibility=Default Availability=Available
// [-2] void setReadBufferSize(qint64)
/*
Reimplemented from QAbstractSocket::setReadBufferSize().
Sets the size of QSslSocket's internal read buffer to be size bytes.
This function was introduced in Qt 4.4.
*/
func (this *QSslSocket) SetReadBufferSize(size int64) {
rv, err := qtrt.InvokeQtFunc6("_ZN10QSslSocket17setReadBufferSizeEx", qtrt.FFI_TYPE_POINTER, this.GetCthis(), size)
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtNetwork/qsslsocket.h:127
// index:0
// Public Visibility=Default Availability=Available
// [8] qint64 encryptedBytesAvailable() const
/*
Returns the number of encrypted bytes that are awaiting decryption. Normally, this function will return 0 because QSslSocket decrypts its incoming data as soon as it can.
This function was introduced in Qt 4.4.
*/
func (this *QSslSocket) EncryptedBytesAvailable() int64 {
rv, err := qtrt.InvokeQtFunc6("_ZNK10QSslSocket23encryptedBytesAvailableEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
return int64(rv) // 222
}
// /usr/include/qt/QtNetwork/qsslsocket.h:128
// index:0
// Public Visibility=Default Availability=Available
// [8] qint64 encryptedBytesToWrite() const
/*
Returns the number of encrypted bytes that are waiting to be written to the network.
This function was introduced in Qt 4.4.
*/
func (this *QSslSocket) EncryptedBytesToWrite() int64 {
rv, err := qtrt.InvokeQtFunc6("_ZNK10QSslSocket21encryptedBytesToWriteEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
return int64(rv) // 222
}
// /usr/include/qt/QtNetwork/qsslsocket.h:131
// index:0
// Public Visibility=Default Availability=Available
// [8] QSslConfiguration sslConfiguration() const
/*
Returns the socket's SSL configuration state. The default SSL configuration of a socket is to use the default ciphers, default CA certificates, no local private key or certificate.
The SSL configuration also contains fields that can change with time without notice.
This function was introduced in Qt 4.4.
See also setSslConfiguration(), localCertificate(), peerCertificate(), peerCertificateChain(), sessionCipher(), privateKey(), ciphers(), and caCertificates().
*/
func (this *QSslSocket) SslConfiguration() *QSslConfiguration /*123*/ {
rv, err := qtrt.InvokeQtFunc6("_ZNK10QSslSocket16sslConfigurationEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
rv2 := /*==*/ NewQSslConfigurationFromPointer(unsafe.Pointer(uintptr(rv))) // 333
qtrt.SetFinalizer(rv2 /*==*/, DeleteQSslConfiguration)
return rv2
}
// /usr/include/qt/QtNetwork/qsslsocket.h:132
// index:0
// Public Visibility=Default Availability=Available
// [-2] void setSslConfiguration(const QSslConfiguration &)
/*
Sets the socket's SSL configuration to be the contents of configuration. This function sets the local certificate, the ciphers, the private key and the CA certificates to those stored in configuration.
It is not possible to set the SSL-state related fields.
This function was introduced in Qt 4.4.
See also sslConfiguration(), setLocalCertificate(), setPrivateKey(), setCaCertificates(), and setCiphers().
*/
func (this *QSslSocket) SetSslConfiguration(config QSslConfiguration_ITF) {
var convArg0 unsafe.Pointer
if config != nil && config.QSslConfiguration_PTR() != nil {
convArg0 = config.QSslConfiguration_PTR().GetCthis()
}
rv, err := qtrt.InvokeQtFunc6("_ZN10QSslSocket19setSslConfigurationERK17QSslConfiguration", qtrt.FFI_TYPE_POINTER, this.GetCthis(), convArg0)
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtNetwork/qsslsocket.h:138
// index:0
// Public Visibility=Default Availability=Available
// [-2] void setLocalCertificate(const QSslCertificate &)
/*
Sets the socket's local certificate to certificate. The local certificate is necessary if you need to confirm your identity to the peer. It is used together with the private key; if you set the local certificate, you must also set the private key.
The local certificate and private key are always necessary for server sockets, but are also rarely used by client sockets if the server requires the client to authenticate.
Note: Secure Transport SSL backend on macOS may update the default keychain (the default is probably your login keychain) by importing your local certificates and keys. This can also result in system dialogs showing up and asking for permission when your application is using these private keys. If such behavior is undesired, set the QT_SSL_USE_TEMPORARY_KEYCHAIN environment variable to a non-zero value; this will prompt QSslSocket to use its own temporary keychain.
See also localCertificate() and setPrivateKey().
*/
func (this *QSslSocket) SetLocalCertificate(certificate QSslCertificate_ITF) {
var convArg0 unsafe.Pointer
if certificate != nil && certificate.QSslCertificate_PTR() != nil {
convArg0 = certificate.QSslCertificate_PTR().GetCthis()
}