Go TLS TCP Client library
Definition of a secure layer transfer channel using TLS Serve/Client PEM certificates/keys only protocol.
- Go TCP Server Server side application
Client starts with a single client certificate/key pair.
Call --help
or -h
from command line to print out the Server command help.
Call help
to print the list of available plugged-in commands with the syntax.
Source test script is :
[test-client-with-args.sh](/test-client-with-args.sh)
It accepts optional parameters or the help request.
Here a sample screen of commands help request:
Available commands are:
-
transfer-file: transfers files, create folders and copy folder files into to the remote server
-
shell: can run interactively (command prompt, without any parameter) or can run not interactively commands and script remotely, copying script files remotely, executing them and deleting the remote files at the end of the execution.
In order to enter command shell on the remote server you can use the sample script:
./test-client-with-args.sh shell
You can produce test client/server certificates using following provided script:
makecert.sh [-d] or using any of provided parameters.
Run it without any parameter to read the usage.
Build client:
go.exe install -v -gcflags "-N -l" github.com/hellgate75/go-tcp-client
See following sample
package my-package
import(
"github.com/hellgate75/go-tcp-client/client/worker"
"github.com/hellgate75/go-tcp-client/common"
)
func myfunc() {
var certPair common.CertificateKeyPair = common.CertificateKeyPair{
Cert: "/etc/ssl/client.pem",
Key: "/etc/ssl/client.key",
}
var host string = "my-remote-server-host-or-ip"
var port string = "49022 or your custom port"
var insecureSkipVerify bool = false //depends on the server configuration, hopefully you use mandatory certificate check!!
var client common.TCPClient = worker.NewClient(certPair, host, port)
client.Open(insecureSkipVerify)
................
................
................
}
Plug-in commands are available for call using the client method common.TCPClient::ApplyCommand(command string, params ...interface{}) error
Get server:
go get -u github.com/hellgate75/go-tcp-server
Get client:
go get -u github.com/hellgate75/go-tcp-client
Enjoy the experience.
The library is licensed with LGPL v. 3.0 clauses, with prior authorization of author before any production or commercial use. Use of this library or any extension is prohibited due to high risk of damages due to improper use. No warranty is provided for improper or unauthorized use of this library or any implementation.
Any request can be prompted to the author Fabrizio Torelli at the following email address: