Commit Graph

510 Commits

Author SHA1 Message Date
Colin Sullivan
57785c55fb Bump ChaCha ciphers in preferences 2017-01-05 16:02:04 -07:00
Colin Sullivan
62693855e8 Add ChaCha20 ciphers to the default cipher list. 2017-01-05 11:30:16 -07:00
Colin Sullivan
9312ec21db Update cipher suites and curve preferences for go version 1.8 2016-12-30 14:24:58 -07:00
Colin Sullivan
b133cda3cd Add curve preference option to configuration files.
* Add a preference to specify and order the curve preferences
* Add details tls help
* Deprecate old 1.4 cipher suite code
2016-12-27 15:41:48 -07:00
Ivan Kozlovic
bc5f864bcc Merge pull request #409 from nats-io/implicit_route_retries
[ADDED] Configure number of connect retries for implicit routes
2016-12-22 15:21:45 -07:00
Ivan Kozlovic
d3555053d0 Change option/parameter name 2016-12-22 14:59:27 -07:00
Christophe de Vienne
696296408c Comment GetTLSConnectionState() 2016-12-22 17:42:43 +01:00
Christophe de Vienne
872c9e0c39 Test GetTLSConnectionState
Run GetTLSConnectionState on a non-tls connection (in a dedicated test)
and a tls connection.
Because initializing the TLS connection in the tests is non-trivial,

I hijacked the TestTLSCloseClientConnection test.
2016-12-21 10:42:50 +01:00
Christophe de Vienne
f94983a9a4 Add TLS infos to ClientAuth interface
It makes it possible to implement a Auth that uses client TLS certificates
to identify them.
2016-12-21 10:31:22 +01:00
Ivan Kozlovic
8e68e0cf80 Add code coverage for cluster's config file parameters 2016-12-20 19:04:59 -07:00
Ivan Kozlovic
a8dfaeae3d [ADDED] Ability to configure number of connect retries for implicit routes
When a server is told to connect to a server (with auto-discovery),
it tries to connect once. There have been a report where that
connection fails, but would probably succeed if tried again (#408).
This new parameter allows to configure the number of times a failed
implicit connect should be tried.

Resolves #408
2016-12-20 18:37:23 -07:00
Ivan Kozlovic
614c435b08 Release v0.9.6 2016-12-15 15:38:15 -07:00
Ivan Kozlovic
5f471b6e7f Replace GetListenEndpoint() with ReadyForConnections()
The RunServer() function (and the various variants)
call Server.Start() in a go-routine, but do not return until
it has verified that the server is ready to accept connections.
To do so, it use GetListenEndpoint() to get a suitable connect
address (replacing "0.0.0.0" or "::" with localhost - important
on Windows). It then creates a raw TCP connection to ensure the
server is started, repeating the process in case of failure up
to 10 seconds.

This PR replaces this with a function that checks that client
listener, and route listener if configured, are set. This removes
the need to get a connect address and create test tcp connections.

The reason for this change is that NATS Streaming when starting
the NATS Server (unless configured to connect to a remote one)
calls RunServerWithAuth(), which when getting "localhost" from
GetListenEndpoint(), would fail trying to resolve it. This happened
for the NATS Streaming Docker image built with Go 1.7+.
2016-12-09 14:03:45 -07:00
Derek Collison
874921ed9f Remove comment for old cluster options 2016-12-02 15:14:36 -08:00
Derek Collison
8fbacaaea1 Cleanup for cluster opts 2016-12-02 14:29:22 -08:00
Waldemar Quevedo
ff2d6d1983 Add function and test for processing sub command args 2016-12-01 18:18:52 -08:00
Ivan Kozlovic
fda43ea564 Remove non needed test for ErrTooManyConnections in client's readLoop
Since we now return an error before setting up the client's readLoop,
testing for this error in readLoop in not needed.
2016-12-01 09:54:12 -07:00
Ivan Kozlovic
ca268290a6 Perform the check on accept, not in processing CONNECT
This will protect the server from non NATS clients (telnet, etc),
or misbehaving clients that would create the tcp connection but
block before sending the CONNECT.
The drawback is that the client may or may not receive the error
message (in my tests, it was getting only between 10%-20% of times).
2016-12-01 08:48:04 -07:00
Ivan Kozlovic
6bcd324955 [FIXED] Honor max_connections setting
The max_connections config parameter was accepted but the server
would not check this limit when processing client connections.

Resolves #386
2016-11-30 18:20:12 -07:00
Waldemar Quevedo
2a8aa96af4 Remove "max_pending_size" option
Previous implementations of the server checked the pending data size
being currently buffered for a client to detect slow consumers,
though this does not apply to latest version of the server so removing
it as a config option to avoid confusion as it is not implemented.
2016-11-22 20:07:39 -08:00
Colin Sullivan
e9dc5fa054 Updates based on comments 2016-11-22 16:22:51 -07:00
Colin Sullivan
ccca711edd Differentiate signal handling for windows.
Windows has limited support for signals, and does not define syscall.SIGUSR1.  Log rotation will be handled differently in windows.

* Add signal.go for all non-windows builds
* Add signal_windows.go for windows builds.

Today, windows looks to be the only platform that does not have syscall.SIGUSR1 defined.
2016-11-22 15:22:34 -07:00
Derek Collison
1c32f28934 Support to reopen file based logs for rotation 2016-11-21 21:55:24 -08:00
Derek Collison
9e92aaa2de Version bump 2016-11-21 15:12:18 -08:00
Derek Collison
e57c949658 Add support for 'include' to configuration files 2016-11-21 14:58:05 -08:00
Derek Collison
61e0b758d7 Updates for Go client rename, update vendor dependencies 2016-11-20 13:15:37 -08:00
Volodymyr Khoroz
a35d98eebe [#370] Treat ping interval from config as seconds (there is no point in smaller granularity). 2016-11-16 00:31:38 +02:00
Volodymyr Khoroz
a98b51a5ca [#370] Ability to configure ping_interval and ping_max (with tests) 2016-11-16 00:31:38 +02:00
Derek Collison
8ffdb6b7f6 Merge pull request #367 from nats-io/staticcheck
Add staticcheck analyzer to Travis CI
2016-10-27 10:07:07 -07:00
Colin Sullivan
6281894cc5 Add staticcheck static analyzer to travis.
Included are small fixes to address warnings found in test code.  No functional changes.
2016-10-27 09:51:15 -06:00
Ivan Kozlovic
4997637270 [FIXED] assignment copies lock value for crypto/tls.Config
Running `go vet ./...` with `go 1.7.3` would report the following:

```
server/route.go:342: assignment copies lock value to tlsConfig: crypto/tls.Config contains sync.Once contains sync.Mutex
server/server.go:479: assignment copies lock value to config: crypto/tls.Config contains sync.Once contains sync.Mutex
```

Add a “clone” function while waiting for this to be addressed
by the language itself (https://go-review.googlesource.com/#/c/28075/)
2016-10-20 14:59:29 -06:00
Ivan Kozlovic
9f758bbd0d Use simple if/else 2016-10-06 09:30:49 -06:00
Ivan Kozlovic
44d18c3af6 [FIXED] SetLogger to be able set debug/trace to 0
In NATS Streaming, we have a test - started early on - that was testing
logging and called SetLogger(l, true, true), then reset by calling
SetLogger(l, false, false) to reset the values. That obviously had not
the expected effect.
During profiling, I noticed that there were tons of allocated
objects due to NATS server debug/trace statements caused by that.
2016-10-05 17:56:25 -06:00
Ben Tranter
ad6206078f Fix non-ASCII quotes in HTML
Fixes #304

Changes the non-ASCII curly quotes in the HTML to use the regular ASCII double quotes. Also adds a test to check for the existence of non-ASCII characters in that same HTML.
2016-09-12 11:03:19 -04:00
Ivan Kozlovic
8f7f6e9f8b [FIXED] Client certificate verification when verify is true.
Server was incorrectly requiring a client certificate, but not
verifying it.

Resolves #336
2016-08-25 15:33:13 -06:00
Ivan Kozlovic
dcbf5d8d35 Bump to version v0.9.4 2016-08-18 09:27:43 -06:00
Derek Collison
21e583628f Merge pull request #333 from wallyqs/custom-monitoring-server-listen
Enables using the same listen from server for monitoring endpoint via `-a`
2016-08-18 05:33:46 -05:00
Waldemar Quevedo
e46b187230 Enables using the same listen from server as was specified via -a
in the cmd line for the monitoring server as well.
2016-08-17 23:08:37 -07:00
Derek Collison
1b8cde624a Merge pull request #330 from nats-io/ignore_any_in_returned_ips
Check that 0.0.0.0 or [::] is not returned as a client connect URL
2016-08-17 23:20:34 -05:00
Ivan Kozlovic
811e0868ed [FIXED] Data RACE on Unsubscribe when client connection is closed
Resolves #331
2016-08-17 16:46:34 -06:00
Ivan Kozlovic
c543c77c74 Check that 0.0.0.0 or [::] is not returned as a client connect URL 2016-08-17 11:15:05 -06:00
Ivan Kozlovic
e6039e0a8b [FIXED] Server panic when poll for Varz and others concurrently
Resolves #327
2016-08-16 10:50:49 -06:00
Ivan Kozlovic
82dbb3a5ab [ADDED] Option to not advertise to clients cluster's IPs
By default, a server is now sending to its clients the client URLs
of all servers in the cluster. This allows clients to be able
to reconnect to any server in the cluster even if those clients
were not configured with the list of servers in the cluster.

However, there may be cases where it would make sense to disable
this feature. This now can be done with this option/command line
parameter.

Resolves #322
2016-08-12 19:24:12 -06:00
Derek Collison
a31e6b2b77 Merge pull request #324 from nats-io/fix_route_ipv6
[FIXED] Cluster's listener with IPv6
2016-08-12 15:20:36 -07:00
Ivan Kozlovic
3b8412049e [FIXED] Cluster's listener with IPv6
Trying to use IPv6 address for the cluster host would fail.
Also, there were some unclosed channels in case of accept loop
setup failures.

Resolves #323
2016-08-12 15:54:15 -06:00
Ivan Kozlovic
fc7d92a04a [FIXED] When server listens to any interface, return only global IPs
The server was returning all resolved IP addresses, including link
local addresses, which did not make sense for remote clients.

Resolves #321
2016-08-12 14:22:24 -06:00
Ivan Kozlovic
62923be357 Bump version to 0.9.2 2016-08-08 14:56:28 -06:00
Ivan Kozlovic
5185f10fed [FIXED] Route/Cluster override
If the server was started with a cluster section in a configuration
file and one would want to override the routes (using `-routes`) the
server would complain that you need to use `-cluster`. Adding
an override of cluster would not work, server would still complain.
Trying to override simply the cluster listen info (without override
of routes) would also not work.
2016-08-04 13:20:25 -06:00
Ivan Kozlovic
c6d37ecf8f [IMPROVED] Route performance for larger messages 2016-08-01 19:01:34 -06:00
Ivan Kozlovic
6f9d542393 Minor changes based on comments 2016-07-26 12:25:33 -06:00