Initial project import
This commit is contained in:
commit
23f2d29e32
11957 files changed
+1754577
No files matched your search
@@ -0,0 +1,17 @@
|
||||
import io
|
||||
import os
|
||||
import net.mbedtls
|
||||
|
||||
fn main() {
|
||||
mut client := mbedtls.new_ssl_conn(mbedtls.SSLConnectConfig{
|
||||
verify: os.resource_abs_path('cert/ca.crt')
|
||||
cert: os.resource_abs_path('cert/client.crt')
|
||||
cert_key: os.resource_abs_path('cert/client.key')
|
||||
validate: true
|
||||
})!
|
||||
|
||||
client.dial('localhost', 8443)!
|
||||
client.write_string('GET / HTTP/1.1\r\n\r\n')!
|
||||
mut reader := io.new_buffered_reader(reader: client)
|
||||
println(reader.read_line()!)
|
||||
}
|
||||
Reference in new issue
Block a user