Commit Graph

105 Commits

Author SHA1 Message Date
Michael Klishin 968eefa1bb
Bump (c) line year
There are no functional changes to this massive diff.
2025-01-01 17:54:10 -05:00
Loïc Hoguin c0c2c2fbd9
Fix OTP-27 Dialyzer errors in rabbitmq_trust_store 2024-09-30 12:35:42 +02:00
Michal Kuratczyk cfa3de4b2b
Remove unused imports (thanks elp!) 2024-05-23 16:36:08 +02:00
Michael Klishin 01092ff31f
(c) year bumps 2024-01-01 22:02:20 -05:00
Michael Klishin 1b642353ca
Update (c) according to [1]
1. https://investors.broadcom.com/news-releases/news-release-details/broadcom-and-vmware-intend-close-transaction-november-22-2023
2023-11-21 23:18:22 -05:00
Alexey Lebedeff c7da0da8b8 Cleanup dialyzer calls
- Use the same base .plt everywhere, so there is no need to list
standard apps everywhere
- Fix typespecs: some typos and the use of not-exported types
2023-02-06 17:05:30 +01:00
Michael Klishin ec4f1dba7d
(c) year bump: 2022 => 2023 2023-01-01 23:17:36 -05:00
Rin Kuryloski bef2756b5f Fixes for various dialyzer warnings 2022-12-02 09:14:08 +01:00
Jean-Sébastien Pédron 15d9cdea61
Call `rabbit:data_dir/0` instead of `rabbit_mnesia:dir/0`
This is a follow-up commit to the parent commit. To quote part of the
parent commit's message:

> Historically, this was the Mnesia directory. But semantically, this
> should be the reverse: RabbitMQ owns the data directory and Mnesia is
> configured to put its files there too.

Now all subsystems call `rabbit:data_dir/0`. They are not tied to Mnesia
anymore.
2022-11-30 14:41:32 +01:00
Luke Bakken 7fe159edef
Yolo-replace format strings
Replaces `~s` and `~p` with their unicode-friendly counterparts.

```
git ls-files *.erl | xargs sed -i.ORIG -e s/~s>/~ts/g -e s/~p>/~tp/g
```
2022-10-10 10:32:03 +04:00
Michael Klishin e4a0dd277b rabbit_trust_store:load_and_decode_cert/4: be more defensive 2022-09-18 16:17:21 +04:00
Péter Gömöri 52cb5796a3 Remove leftover compiler option for get_stacktrace 2022-05-03 18:40:49 +02:00
Michael Klishin c38a3d697d
Bump (c) year 2022-03-21 01:21:56 +04:00
Luke Bakken 7f0285834e
Fix all uses of file:read_file/1
This is to address another memory leak on win32 reported here:

https://groups.google.com/g/rabbitmq-users/c/UE-wxXerJl8

"RabbitMQ constant memory increase (binary_alloc) in idle state"

The root cause is the Prometheus plugin making repeated calls to `rabbit_misc:otp_version/0` which then calls `file:read_file/1` and leaks memory on win32.

See https://github.com/erlang/otp/issues/5527 for the report to the Erlang team.

Turn `badmatch` into actual error
2022-01-03 11:33:36 -08:00
Michael Klishin 97ff62d3b2
Drop trailing newlines from logged messages where possible
Lager strips trailing newline characters but OTP logger with the default
formatter adds a newline at the end. To avoid unintentional multi-line log
messages we have to revisit most messages logged.

Some log entries are intentionally multiline, others
are printed to stdout directly: newlines are required there
for sensible formatting.
2021-03-11 15:17:37 +01:00
Michael Klishin 52479099ec
Bump (c) year 2021-01-22 09:00:14 +03:00
Michael Klishin 7ec143bf9d Switch to MPL2 2020-07-15 02:52:01 +03:00
mgrafl 7b4732eb07 Reduce log level when refreshing certificates
Log at error level was superfluous during normal operation. 
Fixes #75
2020-05-06 09:49:01 +02:00
Jean-Sébastien Pédron 7f35c3c79a Update copyright (year 2020) 2020-03-10 17:00:40 +01:00
Michael Klishin c9de5658c3 Avoid using erlang:get_stacktrace/0 for improved OTP 23/24 compat 2020-02-27 22:33:22 +03:00
Michael Klishin a03303941a (c) bump 2019-12-29 05:50:37 +03:00
Michael Klishin 9da275e9d7 Make sure to update certificate store even after fetching no certificates
Otherwise certificates would not be expelled from the store.
Caught by a system_SUITE test.
2019-12-17 03:10:41 +03:00
Michael Klishin 0090cfe65f Correct log message formatting 2019-12-17 03:02:39 +03:00
Michael Klishin a80d06346b Be more defensive when refreshing certificates
Closes #73.
2019-12-17 02:38:46 +03:00
Michael Klishin 5d14bd7d0a Cosmetics 2019-12-17 01:29:53 +03:00
Michael Klishin 331898eed3 Cosmetics: prefer application:application:ensure_all_started/1
To be consistent with what RabbitMQ core uses.

Per discussion with @dcorbacho.
2019-06-14 16:26:37 +03:00
Diana Corbacho 037cc53542 HTTP proxy support
Proxy options can be passed to the trust store to set in
the httpc profile. Proxy options are described in:
http://erlang.org/doc/man/httpc.html#set_options-2

Example:
```
[{rabbitmq_trust_store,
  [{proxy_options,
    [
      {proxy, {{"127.0.0.1", 8080},[]}},
      {https_proxy, {{"127.0.0.1", 8080},[]}}
    ]
  }]
}].
```
2019-06-14 12:12:30 +01:00
Spring Operator dd0a171b4c URL Cleanup
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# HTTP URLs that Could Not Be Fixed
These URLs were unable to be fixed. Please review them to see if they can be manually resolved.

* http://blog.listincomprehension.com/search/label/procket (200) with 1 occurrences could not be migrated:
   ([https](https://blog.listincomprehension.com/search/label/procket) result ClosedChannelException).
* http://dozzie.jarowit.net/trac/wiki/TOML (200) with 1 occurrences could not be migrated:
   ([https](https://dozzie.jarowit.net/trac/wiki/TOML) result SSLHandshakeException).
* http://dozzie.jarowit.net/trac/wiki/subproc (200) with 1 occurrences could not be migrated:
   ([https](https://dozzie.jarowit.net/trac/wiki/subproc) result SSLHandshakeException).
* http://e2project.org (200) with 1 occurrences could not be migrated:
   ([https](https://e2project.org) result AnnotatedConnectException).
* http://nitrogenproject.com/ (200) with 2 occurrences could not be migrated:
   ([https](https://nitrogenproject.com/) result ConnectTimeoutException).
* http://proper.softlab.ntua.gr (200) with 1 occurrences could not be migrated:
   ([https](https://proper.softlab.ntua.gr) result SSLHandshakeException).
* http://yaws.hyber.org (200) with 1 occurrences could not be migrated:
   ([https](https://yaws.hyber.org) result AnnotatedConnectException).
* http://choven.ca (503) with 1 occurrences could not be migrated:
   ([https](https://choven.ca) result ConnectTimeoutException).

# Fixed URLs

## Fixed But Review Recommended
These URLs were fixed, but the https status was not OK. However, the https status was the same as the http request or http redirected to an https URL, so they were migrated. Your review is recommended.

* http://fixprotocol.org/ (301) with 1 occurrences migrated to:
  https://fixtrading.org ([https](https://fixprotocol.org/) result SSLHandshakeException).
* http://erldb.org (UnknownHostException) with 1 occurrences migrated to:
  https://erldb.org ([https](https://erldb.org) result UnknownHostException).
* http://example.cert.url/path (UnknownHostException) with 3 occurrences migrated to:
  https://example.cert.url/path ([https](https://example.cert.url/path) result UnknownHostException).

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* http://cloudi.org/ with 27 occurrences migrated to:
  https://cloudi.org/ ([https](https://cloudi.org/) result 200).
* http://erlware.org/ with 1 occurrences migrated to:
  https://erlware.org/ ([https](https://erlware.org/) result 200).
* http://example.com with 2 occurrences migrated to:
  https://example.com ([https](https://example.com) result 200).
* http://inaka.github.io/cowboy-trails/ with 1 occurrences migrated to:
  https://inaka.github.io/cowboy-trails/ ([https](https://inaka.github.io/cowboy-trails/) result 200).
* http://ninenines.eu with 6 occurrences migrated to:
  https://ninenines.eu ([https](https://ninenines.eu) result 200).
* http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html with 1 occurrences migrated to:
  https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html ([https](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) result 200).
* http://www.actordb.com/ with 2 occurrences migrated to:
  https://www.actordb.com/ ([https](https://www.actordb.com/) result 200).
* http://www.cs.kent.ac.uk/projects/wrangler/Home.html with 1 occurrences migrated to:
  https://www.cs.kent.ac.uk/projects/wrangler/Home.html ([https](https://www.cs.kent.ac.uk/projects/wrangler/Home.html) result 200).
* http://www.rabbitmq.com/community-plugins.html with 1 occurrences migrated to:
  https://www.rabbitmq.com/community-plugins.html ([https](https://www.rabbitmq.com/community-plugins.html) result 200).
* http://www.rabbitmq.com/plugin-development.html with 1 occurrences migrated to:
  https://www.rabbitmq.com/plugin-development.html ([https](https://www.rabbitmq.com/plugin-development.html) result 200).
* http://www.rabbitmq.com/plugins.html with 1 occurrences migrated to:
  https://www.rabbitmq.com/plugins.html ([https](https://www.rabbitmq.com/plugins.html) result 200).
* http://www.rebar3.org with 1 occurrences migrated to:
  https://www.rebar3.org ([https](https://www.rebar3.org) result 200).
* http://contributor-covenant.org with 1 occurrences migrated to:
  https://contributor-covenant.org ([https](https://contributor-covenant.org) result 301).
* http://contributor-covenant.org/version/1/3/0/ with 1 occurrences migrated to:
  https://contributor-covenant.org/version/1/3/0/ ([https](https://contributor-covenant.org/version/1/3/0/) result 301).
* http://inaka.github.com/apns4erl with 1 occurrences migrated to:
  https://inaka.github.com/apns4erl ([https](https://inaka.github.com/apns4erl) result 301).
* http://inaka.github.com/edis/ with 1 occurrences migrated to:
  https://inaka.github.com/edis/ ([https](https://inaka.github.com/edis/) result 301).
* http://lasp-lang.org/ with 1 occurrences migrated to:
  https://lasp-lang.org/ ([https](https://lasp-lang.org/) result 301).
* http://saleyn.github.com/erlexec with 1 occurrences migrated to:
  https://saleyn.github.com/erlexec ([https](https://saleyn.github.com/erlexec) result 301).
* http://www.mozilla.org/MPL/ with 4 occurrences migrated to:
  https://www.mozilla.org/MPL/ ([https](https://www.mozilla.org/MPL/) result 301).
* http://zhongwencool.github.io/observer_cli with 1 occurrences migrated to:
  https://zhongwencool.github.io/observer_cli ([https](https://zhongwencool.github.io/observer_cli) result 301).

# Ignored
These URLs were intentionally ignored.

* http://127.0.0.1 with 1 occurrences
* http://127.0.0.1:8000/ with 1 occurrences
2019-03-20 03:24:48 -05:00
Luke Bakken 5f8263b1c4 Ensure new modified date is used in state
lists:ukeymerge had reversed arguments, so the old value was always used

Added some Django debug logging in the example code

Fixes #68
2019-02-21 10:42:40 -08:00
Michael Klishin c51ec9f8a7 Compile on OTP 21 from scratch
Part of rabbitmq/rabbitmq-server#1616.

[#157964874]
2018-06-08 02:18:01 +03:00
Michael Klishin ee168d5ade Merge branch 'stable' 2017-05-10 03:49:56 +03:00
Daniil Fedotov 2604ef9bff Wording 2017-05-08 16:36:56 +01:00
Daniil Fedotov ec5ea5e35e Add a certificate hash to cert_id in the file provider.
[#58]
    Just a file change date can be not enough to detect the certificate
    file change. Add a phash2 hash of a file content to check that certificate
    should be reloaded.
2017-05-08 11:58:40 +01:00
Daniil Fedotov 6f97aadc54 Do not check directory change time.
[#58]
Directory change time is not reliable to detect updates in
certificate files. Time resolution is too big (1 second)
and directory modification time does not update when a file
contents is changed.
2017-05-08 10:30:42 +01:00
Michael Klishin e99a9faee0 Merge branch 'stable' 2017-04-02 22:04:24 +03:00
Michael Klishin e16dcee191 (c) year 2017-04-02 21:49:53 +03:00
Ayanda Dube bb2671b446 Typo fix: 'sertificate' -> 'certificate' 2017-03-24 13:25:24 +01:00
Daniil Fedotov c325b36826 3.7.0 json decoding 2017-02-14 18:09:26 +00:00
Michael Klishin f9d5104344 Merge branch 'stable'
Conflicts:
	.travis.yml
2017-02-10 20:34:53 +03:00
Michael Klishin b449648ea9 `url` in certificate objects should really be `path` 2017-02-10 20:01:53 +03:00
Daniil Fedotov 91f22455de Keep provider state in case of error listing certificates 2017-02-10 15:04:32 +00:00
Daniil Fedotov fe2a3c3b3c Merge branch 'stable' 2017-02-08 13:36:43 +00:00
Daniil Fedotov bc40af382d Fix variable names 2017-02-08 13:24:31 +00:00
Daniil Fedotov cfbb905415 Replace maps with proplists 2017-02-08 13:24:31 +00:00
Daniil Fedotov a44fa6ff3c README about HTTP provider 2017-02-08 13:24:31 +00:00
Daniil Fedotov bf50aafbdd HTTP provider for trust store
Fixes #54

Provider will list certificates as JSON, requiring list of objects
with `id` and `url` fields.
JSON root is an object with a single `certificates` field, containing
a list of certificate objects. (some web services require json root to
be object)
Certificates are loaded as PEM encoded files.
2017-02-08 13:24:31 +00:00
Daniil Fedotov 994fbf675f Fix crash when refreshing certificates 2017-02-08 13:23:41 +00:00
Daniil Fedotov 256ee4b352 Make it compile with R16B03 2017-02-07 15:43:52 +00:00
Michael Klishin 376a978471 Merge branch 'stable'
Conflicts:
	src/rabbit_trust_store_app.erl
2017-01-17 17:53:09 +03:00
Daniil Fedotov 3acc243d40 Naming 2017-01-17 14:35:23 +00:00