123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702 |
- '
- ' Copyright (c) 2007, Cameron Rich
- '
- ' All rights reserved.
- '
- ' Redistribution and use in source and binary forms, with or without
- ' modification, are permitted provided that the following conditions are met:
- '
- ' * Redistributions of source code must retain the above copyright notice,
- ' this list of conditions and the following disclaimer.
- ' * Redistributions in binary form must reproduce the above copyright
- ' notice, this list of conditions and the following disclaimer in the
- ' documentation and/or other materials provided with the distribution.
- ' * Neither the name of the axTLS project nor the names of its
- ' contributors may be used to endorse or promote products derived
- ' from this software without specific prior written permission.
- '
- ' THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- ' "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- ' LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- ' A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- ' CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- ' SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- ' TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- ' DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- ' OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- ' NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- ' THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- '
- '
- ' Demonstrate the use of the axTLS library in VB.NET with a set of
- ' command-line parameters similar to openssl. In fact, openssl clients
- ' should be able to communicate with axTLS servers and visa-versa.
- '
- ' This code has various bits enabled depending on the configuration. To enable
- ' the most interesting version, compile with the 'full mode' enabled.
- '
- ' To see what options you have, run the following:
- ' > axssl.vbnet.exe s_server -?
- ' > axssl.vbnet.exe s_client -?
- '
- ' The axtls shared library must be in the same directory or be found
- ' by the OS.
- '
- Imports System
- Imports System.Net
- Imports System.Net.Sockets
- Imports Microsoft.VisualBasic
- Imports axTLSvb
- Public Class axssl
- '
- ' do_server()
- '
- Public Sub do_server(ByVal build_mode As Integer, _
- ByVal args() As String)
- Dim i As Integer = 1
- Dim port As Integer = 4433
- Dim options As Integer = axtls.SSL_DISPLAY_CERTS
- Dim quiet As Boolean = False
- Dim password As String = Nothing
- Dim private_key_file As String = Nothing
- ' organise the cert/ca_cert lists
- Dim cert_size As Integer = SSLUtil.MaxCerts()
- Dim ca_cert_size As Integer = SSLUtil.MaxCACerts()
- Dim cert(cert_size) As String
- Dim ca_cert(ca_cert_size) As String
- Dim cert_index As Integer = 0
- Dim ca_cert_index As Integer = 0
- While i < args.Length
- If args(i) = "-accept" Then
- If i >= args.Length-1
- print_server_options(build_mode, args(i))
- End If
- i += 1
- port = Int32.Parse(args(i))
- ElseIf args(i) = "-quiet"
- quiet = True
- options = options And Not axtls.SSL_DISPLAY_CERTS
- ElseIf build_mode >= axtls.SSL_BUILD_SERVER_ONLY
- If args(i) = "-cert"
- If i >= args.Length-1 Or cert_index >= cert_size
- print_server_options(build_mode, args(i))
- End If
- i += 1
- cert(cert_index) = args(i)
- cert_index += 1
- ElseIf args(i) = "-key"
- If i >= args.Length-1
- print_server_options(build_mode, args(i))
- End If
- i += 1
- private_key_file = args(i)
- options = options Or axtls.SSL_NO_DEFAULT_KEY
- ElseIf args(i) = "-pass"
- If i >= args.Length-1
- print_server_options(build_mode, args(i))
- End If
- i += 1
- password = args(i)
- ElseIf build_mode >= axtls.SSL_BUILD_ENABLE_VERIFICATION
- If args(i) = "-verify" Then
- options = options Or axtls.SSL_CLIENT_AUTHENTICATION
- ElseIf args(i) = "-CAfile"
- If i >= args.Length-1 Or _
- ca_cert_index >= ca_cert_size Then
- print_server_options(build_mode, args(i))
- End If
- i += 1
- ca_cert(ca_cert_index) = args(i)
- ca_cert_index += 1
- ElseIf build_mode = axtls.SSL_BUILD_FULL_MODE
- If args(i) = "-debug" Then
- options = options Or axtls.SSL_DISPLAY_BYTES
- ElseIf args(i) = "-state"
- options = options Or axtls.SSL_DISPLAY_STATES
- ElseIf args(i) = "-show-rsa"
- options = options Or axtls.SSL_DISPLAY_RSA
- Else
- print_server_options(build_mode, args(i))
- End If
- Else
- print_server_options(build_mode, args(i))
- End If
- Else
- print_server_options(build_mode, args(i))
- End If
- End If
- i += 1
- End While
- ' Create socket for incoming connections
- Dim ep As IPEndPoint = New IPEndPoint(IPAddress.Any, port)
- Dim server_sock As TcpListener = New TcpListener(ep)
- server_sock.Start()
- '*********************************************************************
- ' This is where the interesting stuff happens. Up until now we've
- ' just been setting up sockets etc. Now we do the SSL handshake.
- '*********************************************************************/
- Dim ssl_ctx As SSLServer = New SSLServer(options, _
- axtls.SSL_DEFAULT_SVR_SESS)
- If ssl_ctx Is Nothing Then
- Console.Error.WriteLine("Error: Server context is invalid")
- Environment.Exit(1)
- End If
- If private_key_file <> Nothing Then
- Dim obj_type As Integer = axtls.SSL_OBJ_RSA_KEY
- If private_key_file.EndsWith(".p8") Then
- obj_type = axtls.SSL_OBJ_PKCS8
- Else If (private_key_file.EndsWith(".p12"))
- obj_type = axtls.SSL_OBJ_PKCS12
- End If
- If ssl_ctx.ObjLoad(obj_type, private_key_file, _
- password) <> axtls.SSL_OK Then
- Console.Error.WriteLine("Error: Private key '" & _
- private_key_file & "' is undefined.")
- Environment.Exit(1)
- End If
- End If
- For i = 0 To cert_index-1
- If ssl_ctx.ObjLoad(axtls.SSL_OBJ_X509_CERT, _
- cert(i), Nothing) <> axtls.SSL_OK Then
- Console.WriteLine("Certificate '" & cert(i) & _
- "' is undefined.")
- Environment.Exit(1)
- End If
- Next
- For i = 0 To ca_cert_index-1
- If ssl_ctx.ObjLoad(axtls.SSL_OBJ_X509_CACERT, _
- ca_cert(i), Nothing) <> axtls.SSL_OK Then
- Console.WriteLine("Certificate '" & ca_cert(i) & _
- "' is undefined.")
- Environment.Exit(1)
- End If
- Next
- Dim buf As Byte() = Nothing
- Dim res As Integer
- Dim ssl As SSL
- While 1
- If Not quiet Then
- Console.WriteLine("ACCEPT")
- End If
- Dim client_sock As Socket = server_sock.AcceptSocket()
- ssl = ssl_ctx.Connect(client_sock)
- ' do the actual SSL handshake
- While 1
- res = ssl_ctx.Read(ssl, buf)
- If res <> axtls.SSL_OK Then
- Exit While
- End If
- ' check when the connection has been established
- If ssl.HandshakeStatus() = axtls.SSL_OK
- Exit While
- End If
- ' could do something else here
- End While
- If res = axtls.SSL_OK Then ' connection established and ok
- If Not quiet
- display_session_id(ssl)
- display_cipher(ssl)
- End If
- ' now read (and display) whatever the client sends us
- While 1
- ' keep reading until we get something interesting
- While 1
- res = ssl_ctx.Read(ssl, buf)
- If res <> axtls.SSL_OK Then
- Exit While
- End If
- ' could do something else here
- End While
- If res < axtls.SSL_OK
- If Not quiet
- Console.WriteLine("CONNECTION CLOSED")
- End If
- Exit While
- End If
- ' convert to String
- Dim str(res) As Char
- For i = 0 To res-1
- str(i) = Chr(buf(i))
- Next
- Console.Write(str)
- End While
- ElseIf Not quiet
- SSLUtil.DisplayError(res)
- End If
- ' client was disconnected or the handshake failed. */
- ssl.Dispose()
- client_sock.Close()
- End While
- ssl_ctx.Dispose()
- End Sub
- '
- ' do_client()
- '
- Public Sub do_client(ByVal build_mode As Integer, _
- ByVal args() As String)
- If build_mode < axtls.SSL_BUILD_ENABLE_CLIENT Then
- print_client_options(build_mode, args(1))
- End If
- Dim i As Integer = 1
- Dim res As Integer
- Dim port As Integer = 4433
- Dim quiet As Boolean = False
- Dim password As String = Nothing
- Dim reconnect As Integer = 0
- Dim private_key_file As String = Nothing
- Dim hostname As String = "127.0.0.1"
- ' organise the cert/ca_cert lists
- Dim ssl As SSL = Nothing
- Dim cert_size As Integer = SSLUtil.MaxCerts()
- Dim ca_cert_size As Integer = SSLUtil.MaxCACerts()
- Dim cert(cert_size) As String
- Dim ca_cert(ca_cert_size) As String
- Dim cert_index As Integer = 0
- Dim ca_cert_index As Integer = 0
- Dim options As Integer = _
- axtls.SSL_SERVER_VERIFY_LATER Or axtls.SSL_DISPLAY_CERTS
- Dim session_id As Byte() = Nothing
- While i < args.Length
- If args(i) = "-connect" Then
- Dim host_port As String
- If i >= args.Length-1
- print_client_options(build_mode, args(i))
- End If
- i += 1
- host_port = args(i)
- Dim index_colon As Integer = host_port.IndexOf(":"C)
- If index_colon < 0 Then
- print_client_options(build_mode, args(i))
- End If
- hostname = New String(host_port.ToCharArray(), _
- 0, index_colon)
- port = Int32.Parse(New String(host_port.ToCharArray(), _
- index_colon+1, host_port.Length-index_colon-1))
- ElseIf args(i) = "-cert"
- If i >= args.Length-1 Or cert_index >= cert_size Then
- print_client_options(build_mode, args(i))
- End If
- i += 1
- cert(cert_index) = args(i)
- cert_index += 1
- ElseIf args(i) = "-key"
- If i >= args.Length-1
- print_client_options(build_mode, args(i))
- End If
- i += 1
- private_key_file = args(i)
- options = options Or axtls.SSL_NO_DEFAULT_KEY
- ElseIf args(i) = "-CAfile"
- If i >= args.Length-1 Or ca_cert_index >= ca_cert_size
- print_client_options(build_mode, args(i))
- End If
- i += 1
- ca_cert(ca_cert_index) = args(i)
- ca_cert_index += 1
- ElseIf args(i) = "-verify"
- options = options And Not axtls.SSL_SERVER_VERIFY_LATER
- ElseIf args(i) = "-reconnect"
- reconnect = 4
- ElseIf args(i) = "-quiet"
- quiet = True
- options = options And Not axtls.SSL_DISPLAY_CERTS
- ElseIf args(i) = "-pass"
- If i >= args.Length-1
- print_client_options(build_mode, args(i))
- End If
- i += 1
- password = args(i)
- ElseIf build_mode = axtls.SSL_BUILD_FULL_MODE
- If args(i) = "-debug" Then
- options = options Or axtls.SSL_DISPLAY_BYTES
- ElseIf args(i) = "-state"
- options = options Or axtls.SSL_DISPLAY_STATES
- ElseIf args(i) = "-show-rsa"
- options = options Or axtls.SSL_DISPLAY_RSA
- Else
- print_client_options(build_mode, args(i))
- End If
- Else ' don't know what this is
- print_client_options(build_mode, args(i))
- End If
- i += 1
- End While
- 'Dim hostInfo As IPHostEntry = Dns.Resolve(hostname)
- Dim hostInfo As IPHostEntry = Dns.GetHostEntry(hostname)
- Dim addresses As IPAddress() = hostInfo.AddressList
- Dim ep As IPEndPoint = New IPEndPoint(addresses(0), port)
- Dim client_sock As Socket = New Socket(AddressFamily.InterNetwork, _
- SocketType.Stream, ProtocolType.Tcp)
- client_sock.Connect(ep)
- If Not client_sock.Connected Then
- Console.WriteLine("could not connect")
- Environment.Exit(1)
- End If
- If Not quiet Then
- Console.WriteLine("CONNECTED")
- End If
- '*********************************************************************
- ' This is where the interesting stuff happens. Up until now we've
- ' just been setting up sockets etc. Now we do the SSL handshake.
- '*********************************************************************/
- Dim ssl_ctx As SSLClient = New SSLClient(options, _
- axtls.SSL_DEFAULT_CLNT_SESS)
- If ssl_ctx Is Nothing Then
- Console.Error.WriteLine("Error: Client context is invalid")
- Environment.Exit(1)
- End If
- If private_key_file <> Nothing Then
- Dim obj_type As Integer = axtls.SSL_OBJ_RSA_KEY
- If private_key_file.EndsWith(".p8") Then
- obj_type = axtls.SSL_OBJ_PKCS8
- Else If (private_key_file.EndsWith(".p12"))
- obj_type = axtls.SSL_OBJ_PKCS12
- End If
- If ssl_ctx.ObjLoad(obj_type, private_key_file, _
- password) <> axtls.SSL_OK Then
- Console.Error.WriteLine("Error: Private key '" & _
- private_key_file & "' is undefined.")
- Environment.Exit(1)
- End If
- End If
- For i = 0 To cert_index-1
- If ssl_ctx.ObjLoad(axtls.SSL_OBJ_X509_CERT, _
- cert(i), Nothing) <> axtls.SSL_OK Then
- Console.WriteLine("Certificate '" & cert(i) & _
- "' is undefined.")
- Environment.Exit(1)
- End If
- Next
- For i = 0 To ca_cert_index-1
- If ssl_ctx.ObjLoad(axtls.SSL_OBJ_X509_CACERT, _
- ca_cert(i), Nothing) <> axtls.SSL_OK Then
- Console.WriteLine("Certificate '" & ca_cert(i) & _
- "' is undefined.")
- Environment.Exit(1)
- End If
- Next
- ' Try session resumption?
- If reconnect > 0 Then
- While reconnect > 0
- reconnect -= 1
- ssl = ssl_ctx.Connect(client_sock, session_id)
- res = ssl.HandshakeStatus()
- If res <> axtls.SSL_OK Then
- If Not quiet Then
- SSLUtil.DisplayError(res)
- End If
- ssl.Dispose()
- Environment.Exit(1)
- End If
- display_session_id(ssl)
- session_id = ssl.GetSessionId()
- If reconnect > 0 Then
- ssl.Dispose()
- client_sock.Close()
-
- ' and reconnect
- client_sock = New Socket(AddressFamily.InterNetwork, _
- SocketType.Stream, ProtocolType.Tcp)
- client_sock.Connect(ep)
- End If
- End While
- Else
- ssl = ssl_ctx.Connect(client_sock, Nothing)
- End If
- ' check the return status
- res = ssl.HandshakeStatus()
- If res <> axtls.SSL_OK Then
- If Not quiet Then
- SSLUtil.DisplayError(res)
- End If
- Environment.Exit(1)
- End If
- If Not quiet Then
- Dim common_name As String = _
- ssl.GetCertificateDN(axtls.SSL_X509_CERT_COMMON_NAME)
- If common_name <> Nothing
- Console.WriteLine("Common Name:" & _
- ControlChars.Tab & ControlChars.Tab & _
- ControlChars.Tab & common_name)
- End If
- display_session_id(ssl)
- display_cipher(ssl)
- End If
- While (1)
- Dim user_input As String = Console.ReadLine()
- If user_input = Nothing Then
- Exit While
- End If
- Dim buf(user_input.Length+1) As Byte
- buf(buf.Length-2) = Asc(ControlChars.Lf) ' add the carriage return
- buf(buf.Length-1) = 0 ' null terminate
- For i = 0 To user_input.Length-1
- buf(i) = Asc(user_input.Chars(i))
- Next
- res = ssl_ctx.Write(ssl, buf, buf.Length)
- If res < axtls.SSL_OK Then
- If Not quiet Then
- SSLUtil.DisplayError(res)
- End If
- Exit While
- End If
- End While
- ssl_ctx.Dispose()
- End Sub
- '
- ' Display what cipher we are using
- '
- Private Sub display_cipher(ByVal ssl As SSL)
- Console.Write("CIPHER is ")
- Select ssl.GetCipherId()
- Case axtls.SSL_AES128_SHA
- Console.WriteLine("AES128-SHA")
- Case axtls.SSL_AES256_SHA
- Console.WriteLine("AES256-SHA")
- Case axtls.SSL_RC4_128_SHA
- Console.WriteLine("RC4-SHA")
- Case axtls.SSL_RC4_128_MD5
- Console.WriteLine("RC4-MD5")
- Case Else
- Console.WriteLine("Unknown - " & ssl.GetCipherId())
- End Select
- End Sub
- '
- ' Display what session id we have.
- '
- Private Sub display_session_id(ByVal ssl As SSL)
- Dim session_id As Byte() = ssl.GetSessionId()
- If session_id.Length > 0 Then
- Console.WriteLine("-----BEGIN SSL SESSION PARAMETERS-----")
- Dim b As Byte
- For Each b In session_id
- Console.Write("{0:x02}", b)
- Next
- Console.WriteLine()
- Console.WriteLine("-----END SSL SESSION PARAMETERS-----")
- End If
- End Sub
- '
- ' We've had some sort of command-line error. Print out the basic options.
- '
- Public Sub print_options(ByVal options As String)
- Console.WriteLine("axssl: Error: '" & options & _
- "' is an invalid command.")
- Console.WriteLine("usage: axssl.vbnet [s_server|s_client|" & _
- "version] [args ...]")
- Environment.Exit(1)
- End Sub
- '
- ' We've had some sort of command-line error. Print out the server options.
- '
- Private Sub print_server_options(ByVal build_mode As Integer, _
- ByVal options As String)
- Dim cert_size As Integer = SSLUtil.MaxCerts()
- Dim ca_cert_size As Integer = SSLUtil.MaxCACerts()
- Console.WriteLine("unknown option " & options)
- Console.WriteLine("usage: s_server [args ...]")
- Console.WriteLine(" -accept arg" & ControlChars.Tab & _
- "- port to accept on (default is 4433)")
- Console.WriteLine(" -quiet" & ControlChars.Tab & ControlChars.Tab & _
- "- No server output")
- If build_mode >= axtls.SSL_BUILD_SERVER_ONLY
- Console.WriteLine(" -cert arg" & ControlChars.Tab & _
- "- certificate file to add (in addition to default) to chain -")
- Console.WriteLine(ControlChars.Tab & ControlChars.Tab & _
- " Can repeat up to " & cert_size & " times")
- Console.WriteLine(" -key arg" & ControlChars.Tab & _
- "- Private key file to use")
- Console.WriteLine(" -pass" & ControlChars.Tab & ControlChars.Tab & _
- "- private key file pass phrase source")
- End If
- If build_mode >= axtls.SSL_BUILD_ENABLE_VERIFICATION
- Console.WriteLine(" -verify" & ControlChars.Tab & _
- "- turn on peer certificate verification")
- Console.WriteLine(" -CAfile arg" & ControlChars.Tab & _
- "- Certificate authority")
- Console.WriteLine(ControlChars.Tab & ControlChars.Tab & _
- " Can repeat up to " & ca_cert_size & " times")
- End If
- If build_mode = axtls.SSL_BUILD_FULL_MODE
- Console.WriteLine(" -debug" & _
- ControlChars.Tab & ControlChars.Tab & _
- "- Print more output")
- Console.WriteLine(" -state" & _
- ControlChars.Tab & ControlChars.Tab & _
- "- Show state messages")
- Console.WriteLine(" -show-rsa" & _
- ControlChars.Tab & "- Show RSA state")
- End If
- Environment.Exit(1)
- End Sub
- '
- ' We've had some sort of command-line error. Print out the client options.
- '
- Private Sub print_client_options(ByVal build_mode As Integer, _
- ByVal options As String)
- Dim cert_size As Integer = SSLUtil.MaxCerts()
- Dim ca_cert_size As Integer = SSLUtil.MaxCACerts()
- Console.WriteLine("unknown option " & options)
- If build_mode >= axtls.SSL_BUILD_ENABLE_CLIENT Then
- Console.WriteLine("usage: s_client [args ...]")
- Console.WriteLine(" -connect host:port - who to connect to " & _
- "(default is localhost:4433)")
- Console.WriteLine(" -verify" & ControlChars.Tab & _
- "- turn on peer certificate verification")
- Console.WriteLine(" -cert arg" & ControlChars.Tab & _
- "- certificate file to use")
- Console.WriteLine(ControlChars.Tab & ControlChars.Tab & _
- " Can repeat up to " & cert_size & " times")
- Console.WriteLine(" -key arg" & ControlChars.Tab & _
- "- Private key file to use")
- Console.WriteLine(" -CAfile arg" & ControlChars.Tab & _
- "- Certificate authority")
- Console.WriteLine(ControlChars.Tab & ControlChars.Tab & _
- " Can repeat up to " & ca_cert_size & " times")
- Console.WriteLine(" -quiet" & _
- ControlChars.Tab & ControlChars.Tab & "- No client output")
- Console.WriteLine(" -pass" & ControlChars.Tab & _
- ControlChars.Tab & _
- "- private key file pass phrase source")
- Console.WriteLine(" -reconnect" & ControlChars.Tab & _
- "- Drop and re-make the " & _
- "connection with the same Session-ID")
- If build_mode = axtls.SSL_BUILD_FULL_MODE Then
- Console.WriteLine(" -debug" & _
- ControlChars.Tab & ControlChars.Tab & _
- "- Print more output")
- Console.WriteLine(" -state" & _
- ControlChars.Tab & ControlChars.Tab & _
- "- Show state messages")
- Console.WriteLine(" -show-rsa" & ControlChars.Tab & _
- "- Show RSA state")
- End If
- Else
- Console.WriteLine("Change configuration to allow this feature")
- End If
- Environment.Exit(1)
- End Sub
- End Class
- Public Module MyMain
- Function Main(ByVal args() As String) As Integer
- Dim runner As axssl = New axssl()
- If args.Length = 1 And args(0) = "version" Then
- Console.WriteLine("axssl.vbnet " & SSLUtil.Version())
- Environment.Exit(0)
- End If
- If args.Length < 1
- runner.print_options("")
- ElseIf args(0) <> "s_server" And args(0) <> "s_client"
- runner.print_options(args(0))
- End If
- Dim build_mode As Integer = SSLUtil.BuildMode()
- If args(0) = "s_server" Then
- runner.do_server(build_mode, args)
- Else
- runner.do_client(build_mode, args)
- End If
- End Function
- End Module
|