Commit Graph
26 Commits
Author SHA1 Message Date
Eli Young 908eebe3d9 Avoid nil deref when using Postgres StartTLS
Fixes #234
2021-07-15 13:04:33 -07:00
Matthew McPherrin 26cd65d9bd refactor certigo package main
This splits the logic into a cli, which handles parsing command line args and
reading files, and a terminal abstraction for handling user input and ouput.

All uses of os.Exit are removed in favor of returning errors.

Overall this enables better testing and reuse of code.  Previously we had to
rely on external unit testing for CLI tests, which are harder to write tests.
2020-01-13 15:58:53 -08:00
Matthew McPherrin e336bddafc Add support for proxy authentication
This only supports the simplest case: a username and password in the proxy URL,
and http basic auth.
2020-01-09 22:56:50 -08:00
Cedric Staub 25850151d7 Rename dumpAuthTLSFromXXX methods 2019-05-21 11:20:24 -07:00
Seth Theriault 75258cfd3c Add support for IMAP STARTTLS 2019-05-21 11:57:46 -04:00
CodeLingo Bot f328dcd6cc Fix function comments based on best practices from Effective Go
Signed-off-by: CodeLingo Bot <bot@codelingo.io>
2019-02-18 11:35:49 +00:00
Cedric Staub 399ed9bc6e Fix SNI handling, set server name for connect 2018-04-03 21:47:37 -07:00
Matthew McPherrinandMatthew McPherrin 58f10be303 Add an aliased --starttls. DRY the protocols by putting them in starttls.go
Unfortunately kingpin doesn't support natively support aliased flag names, so
you can supply both --start-tls and --starttls without an error, but that's
just "holding it wrong".
2018-03-14 18:09:03 -07:00
Matthew McPherrinandMatthew McPherrin c22acb0991 More robust parsing of FTP protocol
I found some servers don't always return a space after the three-digit code
for example,

certigo connect --start-tls ftp ftp.mirrorservice.org:21
error connecting: FTP server responded with status 220-----------------------------------------------------------------------------
, was expecting 220

Instead, we always take the first three digits and parse them as an integer, rather than
relying on the space.  Makes the code look a little cleaner too, by returning it as an int.
2018-03-14 18:08:41 -07:00
Matthew McPherrin cbdcc47d56 Add protocol-specific default ports
If otherwise unspecified, default to port 443.
If a starttls protocol is given, use a protocol-specific default.

So now "certigo connect squareup.com" works.
2018-03-10 19:38:29 -08:00
Cedric Staub 15a4a957d6 Add HTTP(S) CONNECT proxy support to certigo 2017-10-11 15:53:44 -07:00
Cedric Staub 5a9a11db35 Add support for showing requested client certificate info 2017-04-08 14:55:37 -07:00
Matthew McPherrin b61f9af0af Review feedback: Flag named --identity and a better description
Validate --identity can only be used with --start-tls
2017-03-31 23:57:29 -07:00
Matthew McPherrin 60f1c25a94 Add a --asuser flag which sets DB user & stmp EHLO hostname. 2017-03-31 15:36:38 -07:00
Matthew McPherrin 0232a800cf smtp hello as certigo 2017-03-31 13:51:01 -07:00
Cedric Staub c3b6ec93dc Support connect timeouts 2017-03-09 15:03:56 -08:00
Cedric Staub 2404cbbd3d Implement AUTH TLS for FTP servers 2017-02-24 20:29:43 -08:00
Matthew McPherrin c368df917a Allow SSL 3.0, so we can see old and bad servers. 2017-02-19 14:36:31 -08:00
Matthew McPherrin 5c0832b26f ldap starttls support 2017-02-18 23:45:16 -08:00
Matthew McPherrin 84fb87afa5 Add TLSConnectionState() method to forked ldap package 2017-02-18 23:45:16 -08:00
Matthew McPherrin 65c225f0e3 Vendor starttls for forking 2017-02-18 23:45:16 -08:00
Matthew McPherrin 0e9f91f9cc Change some variable names in the starttls package
They made sense in the certigo main() context, but seem weird here.
2017-02-18 23:28:42 -08:00
Matthew McPherrin 27ac287248 Panic for impossible error 2017-02-17 15:56:19 -08:00
Matthew McPherrin 4cc48a1ee6 Add SMTP support to STARTTLS 2017-02-17 15:49:03 -08:00
Matthew McPherrin 98dbc46373 Remove print and os.Exit from starttls library 2017-02-17 15:34:18 -08:00
Matthew McPherrin 35679297a9 Move StartTLS functionality into a subpackage, enabling use elsewhere
This moves two functions out of main.go.
The only change to the functions was to make them take arguments, instead of using global variables in main.

The mysql and psql imports are moved here too.
2017-02-17 12:39:57 -08:00