remoton

Check-in [240166e12f]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:cmd/remoton-client-desktop: add flag -insecure for skip validation tls
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256:240166e12f1ea3b32e9e9b0eac8e01659dddc12a4fe893bdb0da16d42957662d
User & Date: bit4bit@riseup.net 2016-08-04 14:11:53
Context
2016-08-04
15:07
omit certificate when use -insecure check-in: 5c28df9e61 user: bit4bit@riseup.net tags: master, trunk
14:11
cmd/remoton-client-desktop: add flag -insecure for skip validation tls check-in: 240166e12f user: bit4bit@riseup.net tags: master, trunk
14:10
cmd/remoton-support-desktop: add flag -insecure for skip validation tls check-in: fe316eab8c user: bit4bit@riseup.net tags: master, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to cmd/remoton-client-desktop/client.go.

286
287
288
289
290
291
292




293
294
295
296
297
298
299
func (c *clientRemoton) Started() bool {
	return c.started
}

func (c *clientRemoton) SetCertPool(roots *x509.CertPool) {
	c.client.TLSConfig.RootCAs = roots
}





func (c *clientRemoton) Start(srvAddr string, authToken, password string) error {
	var err error
	c.session, err = c.client.NewSession("https://"+srvAddr, authToken)
	if err != nil {
		return err
	}







>
>
>
>







286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
func (c *clientRemoton) Started() bool {
	return c.started
}

func (c *clientRemoton) SetCertPool(roots *x509.CertPool) {
	c.client.TLSConfig.RootCAs = roots
}

func (c *clientRemoton) SetInsecure() {
	c.client.TLSConfig.InsecureSkipVerify = true
}

func (c *clientRemoton) Start(srvAddr string, authToken, password string) error {
	var err error
	c.session, err = c.client.NewSession("https://"+srvAddr, authToken)
	if err != nil {
		return err
	}

Changes to cmd/remoton-client-desktop/main.go.

4
5
6
7
8
9
10

11
12
13
14
15
16
17
..
26
27
28
29
30
31
32

33
34
35


36
37
38
39
40
41
42
...
136
137
138
139
140
141
142


143
144
145
146
147
148
149
150
//Environment Vars:
//  * REMOTON_SERVER : set default remote server to connect

//+build linux,windows
package main

import (

	"crypto/tls"
	"net"
	"os"
	"os/signal"
	"path/filepath"
	"runtime"
	"syscall"
................................................................................
	"github.com/mattn/go-gtk/glib"
	"github.com/mattn/go-gtk/gtk"
)

var (
	clremoton       *clientRemoton
	machinePassword string

)

func main() {


	runtime.GOMAXPROCS(runtime.NumCPU())
	common.SetDefaultGtkTheme()

	machinePassword = uuid.New()[:4]
	clremoton = newClient(&remoton.Client{Prefix: "/remoton", TLSConfig: &tls.Config{}})
	sigs := make(chan os.Signal, 1)
	signal.Notify(sigs, syscall.SIGHUP, syscall.SIGINT, syscall.SIGABRT, syscall.SIGKILL, syscall.SIGTERM)
................................................................................
	btnSrv.Clicked(func() {
		certPool, err := common.GetRootCAFromFile(getCertFilename())
		if err != nil {
			dialogError(window, err)
			return
		}
		clremoton.SetCertPool(certPool)



		if !clremoton.Started() {
			log.Println("starting remoton")
			machinePassword = uuid.New()[:4]
			err := clremoton.Start(serverEntry.GetText(), authServerEntry.GetText(),
				machinePassword)

			if err != nil {







>







 







>



>
>







 







>
>
|







4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
..
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
...
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
//Environment Vars:
//  * REMOTON_SERVER : set default remote server to connect

//+build linux,windows
package main

import (
	"flag"
	"crypto/tls"
	"net"
	"os"
	"os/signal"
	"path/filepath"
	"runtime"
	"syscall"
................................................................................
	"github.com/mattn/go-gtk/glib"
	"github.com/mattn/go-gtk/gtk"
)

var (
	clremoton       *clientRemoton
	machinePassword string
	insecure = flag.Bool("insecure", false, "skip verify tls")
)

func main() {
	flag.Parse()
	
	runtime.GOMAXPROCS(runtime.NumCPU())
	common.SetDefaultGtkTheme()

	machinePassword = uuid.New()[:4]
	clremoton = newClient(&remoton.Client{Prefix: "/remoton", TLSConfig: &tls.Config{}})
	sigs := make(chan os.Signal, 1)
	signal.Notify(sigs, syscall.SIGHUP, syscall.SIGINT, syscall.SIGABRT, syscall.SIGKILL, syscall.SIGTERM)
................................................................................
	btnSrv.Clicked(func() {
		certPool, err := common.GetRootCAFromFile(getCertFilename())
		if err != nil {
			dialogError(window, err)
			return
		}
		clremoton.SetCertPool(certPool)
		if *insecure {
			clremoton.SetInsecure()
		}
		if !clremoton.Started() {
			log.Println("starting remoton")
			machinePassword = uuid.New()[:4]
			err := clremoton.Start(serverEntry.GetText(), authServerEntry.GetText(),
				machinePassword)

			if err != nil {