File tree Expand file tree Collapse file tree 4 files changed +31
-5
lines changed Expand file tree Collapse file tree 4 files changed +31
-5
lines changed Original file line number Diff line number Diff line change @@ -28,3 +28,5 @@ install(
28
28
TARGETS tlspool_static
29
29
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
30
30
)
31
+
32
+ add_subdirectory (python )
Original file line number Diff line number Diff line change
1
+ # add_custom_target?
2
+ # add_custom_command(TARGET libtlspool-python
3
+ # POST_BUILD
4
+ # COMMAND CFLAGS=I${CMAKE_SOURCE_DIR}/include python setup.py build)
5
+ #
6
+ # add_dependencies
7
+
8
+ # install(CODE "execute_process COMMAND CFLAGS=-I${CMAKE_SOURCE_DIR}/include python setup.py install")
9
+ # install(CODE "execute_process(COMMAND CFLAGS=-I${CMAKE_SOURCE_DIR}/include python setup.py install)")
10
+ install (CODE "execute_process(COMMAND python setup.py install WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )" )
11
+
12
+ install (PROGRAMS webdemo.py
13
+ DESTINATION /usr/local/bin )
Original file line number Diff line number Diff line change 6
6
sys .path .append ('.' )
7
7
import tlspool
8
8
9
- if len (sys .argv ) == 2 :
10
- tlspool .open_poolhandle (sys .argv [1 ])
9
+ if len (sys .argv ) >= 2 :
10
+ website = sys .argv [1 ]
11
+ else :
12
+ website = 'nlnet.nl'
13
+
14
+ if len (sys .argv ) >= 3 :
15
+ tlspool .open_poolhandle (sys .argv [2 ])
11
16
12
17
sox = socket .socket (socket .AF_INET6 , socket .SOCK_STREAM )
13
- sox .connect ( ('www.arpa2.net' , 443 ) )
18
+ sox .connect ( (website , 443 ) )
14
19
15
20
cli2srv = ( tlspool .PIOF_STARTTLS_LOCALROLE_CLIENT |
16
21
tlspool .PIOF_STARTTLS_REMOTEROLE_SERVER )
17
22
cnx = tlspool .Connection (sox , service = 'http' , flags = cli2srv )
18
23
19
24
cnx .tlsdata .localid = 'testcli@tlspool.arpa2.lab'
20
- cnx .tlsdata .remoteid = 'www.arpa2.net'
25
+ cnx .tlsdata .remoteid = website
21
26
22
27
web = cnx .starttls ()
23
28
24
- web .send ('GET / HTTP/1.0\r \n Host: www.arpa2.net \r \n \r \n ' )
29
+ web .send ('GET / HTTP/1.0\r \n Host: ' + website + ' \r \n \r \n ' )
25
30
26
31
dta = web .recv (4096 )
27
32
while dta != '' :
Original file line number Diff line number Diff line change @@ -52,3 +52,9 @@ install(
52
52
TARGETS tlspool
53
53
DESTINATION ${CMAKE_INSTALL_SBINDIR}
54
54
)
55
+
56
+ install (
57
+ DIRECTORY ${CMAKE_SOURCE_DIR} /include/tlspool/
58
+ DESTINATION /usr/include/tlspool
59
+ )
60
+
You can’t perform that action at this time.
0 commit comments