Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor!: use rustls instead of native-tls #4901

Merged
merged 14 commits into from
Jul 18, 2024

Conversation

kwaa
Copy link
Contributor

@kwaa kwaa commented Jul 15, 2024

Part of #4900

@kwaa kwaa marked this pull request as ready for review July 15, 2024 13:58
@kwaa kwaa changed the title refactor(utils): remove unused apub utils refactor(utils): remove unused apub util Jul 15, 2024
Cargo.toml Show resolved Hide resolved
@kwaa kwaa changed the title refactor(utils): remove unused apub util refactor!: use rustls instead of openssl Jul 15, 2024
@kwaa kwaa changed the title refactor!: use rustls instead of openssl refactor!: use rustls instead of native-tls Jul 15, 2024
@dessalines
Copy link
Member

Even after this its still getting:

openssl v0.10.64
└── native-tls v0.2.12
    ├── hyper-tls v0.5.0
    │   └── reqwest v0.11.27
    │       ├── activitypub_federation v0.5.8
    │       │   ├── lemmy_api v0.19.5 (/home/xxx/git/lemmy/crates/api)
    │       │   │   └── lemmy_server v0.19.5 (/home/xxx/git/lemmy)
    │       │   ├── lemmy_api_common v0.19.5 (/home/xxx/git/lemmy/crates/api_common)
    │       │   │   ├── lemmy_api v0.19.5 (/home/xxx/git/lemmy/crates/api) (*)
    │       │   │   ├── lemmy_api_crud v0.19.5 (/home/xxx/git/lemmy/crates/api_crud)
    │       │   │   │   └── lemmy_server v0.19.5 (/home/xxx/git/lemmy)
    │       │   │   ├── lemmy_apub v0.19.5 (/home/xxx/git/lemmy/crates/apub)
    │       │   │   │   ├── lemmy_federate v0.19.5 (/home/xxx/git/lemmy/crates/federate)
    │       │   │   │   │   └── lemmy_server v0.19.5 (/home/xxx/git/lemmy)
    │       │   │   │   └── lemmy_server v0.19.5 (/home/xxx/git/lemmy)
    │       │   │   ├── lemmy_federate v0.19.5 (/home/xxx/git/lemmy/crates/federate) (*)
    │       │   │   ├── lemmy_routes v0.19.5 (/home/xxx/git/lemmy/crates/routes)
    │       │   │   │   └── lemmy_server v0.19.5 (/home/xxx/git/lemmy)
    │       │   │   └── lemmy_server v0.19.5 (/home/xxx/git/lemmy)
    │       │   ├── lemmy_api_crud v0.19.5 (/home/xxx/git/lemmy/crates/api_crud) (*)
    │       │   ├── lemmy_apub v0.19.5 (/home/xxx/git/lemmy/crates/apub) (*)
    │       │   ├── lemmy_db_schema v0.19.5 (/home/xxx/git/lemmy/crates/db_schema)
    │       │   │   ├── lemmy_api v0.19.5 (/home/xxx/git/lemmy/crates/api) (*)
    │       │   │   ├── lemmy_api_common v0.19.5 (/home/xxx/git/lemmy/crates/api_common) (*)
    │       │   │   ├── lemmy_api_crud v0.19.5 (/home/xxx/git/lemmy/crates/api_crud) (*)
    │       │   │   ├── lemmy_apub v0.19.5 (/home/xxx/git/lemmy/crates/apub) (*)
    │       │   │   ├── lemmy_db_views v0.19.5 (/home/xxx/git/lemmy/crates/db_views)
    │       │   │   │   ├── lemmy_api v0.19.5 (/home/xxx/git/lemmy/crates/api) (*)
    │       │   │   │   ├── lemmy_api_common v0.19.5 (/home/xxx/git/lemmy/crates/api_common) (*)
    │       │   │   │   ├── lemmy_api_crud v0.19.5 (/home/xxx/git/lemmy/crates/api_crud) (*)
    │       │   │   │   ├── lemmy_apub v0.19.5 (/home/xxx/git/lemmy/crates/apub) (*)
    │       │   │   │   └── lemmy_routes v0.19.5 (/home/xxx/git/lemmy/crates/routes) (*)
    │       │   │   ├── lemmy_db_views_actor v0.19.5 (/home/xxx/git/lemmy/crates/db_views_actor)
    │       │   │   │   ├── lemmy_api v0.19.5 (/home/xxx/git/lemmy/crates/api) (*)
    │       │   │   │   ├── lemmy_api_common v0.19.5 (/home/xxx/git/lemmy/crates/api_common) (*)
    │       │   │   │   ├── lemmy_api_crud v0.19.5 (/home/xxx/git/lemmy/crates/api_crud) (*)
    │       │   │   │   ├── lemmy_apub v0.19.5 (/home/xxx/git/lemmy/crates/apub) (*)
    │       │   │   │   ├── lemmy_federate v0.19.5 (/home/xxx/git/lemmy/crates/federate) (*)
    │       │   │   │   └── lemmy_routes v0.19.5 (/home/xxx/git/lemmy/crates/routes) (*)
    │       │   │   ├── lemmy_db_views_moderator v0.19.5 (/home/xxx/git/lemmy/crates/db_views_moderator)
    │       │   │   │   ├── lemmy_api v0.19.5 (/home/xxx/git/lemmy/crates/api) (*)
    │       │   │   │   └── lemmy_api_common v0.19.5 (/home/xxx/git/lemmy/crates/api_common) (*)
    │       │   │   ├── lemmy_federate v0.19.5 (/home/xxx/git/lemmy/crates/federate) (*)
    │       │   │   ├── lemmy_routes v0.19.5 (/home/xxx/git/lemmy/crates/routes) (*)
    │       │   │   └── lemmy_server v0.19.5 (/home/xxx/git/lemmy)
    │       │   ├── lemmy_federate v0.19.5 (/home/xxx/git/lemmy/crates/federate) (*)
    │       │   ├── lemmy_routes v0.19.5 (/home/xxx/git/lemmy/crates/routes) (*)
    │       │   └── lemmy_server v0.19.5 (/home/xxx/git/lemmy)
    │       ├── http-signature-normalization-reqwest v0.10.0
    │       │   └── activitypub_federation v0.5.8 (*)
    │       ├── lemmy_api_common v0.19.5 (/home/xxx/git/lemmy/crates/api_common) (*)
    │       ├── lemmy_apub v0.19.5 (/home/xxx/git/lemmy/crates/apub) (*)
    │       ├── lemmy_federate v0.19.5 (/home/xxx/git/lemmy/crates/federate) (*)
    │       ├── lemmy_routes v0.19.5 (/home/xxx/git/lemmy/crates/routes) (*)
    │       ├── lemmy_server v0.19.5 (/home/xxx/git/lemmy)
    │       ├── reqwest-middleware v0.2.5
    │       │   ├── activitypub_federation v0.5.8 (*)
    │       │   ├── http-signature-normalization-reqwest v0.10.0 (*)
    │       │   ├── lemmy_api_common v0.19.5 (/home/xxx/git/lemmy/crates/api_common) (*)
    │       │   ├── lemmy_routes v0.19.5 (/home/xxx/git/lemmy/crates/routes) (*)
    │       │   ├── lemmy_server v0.19.5 (/home/xxx/git/lemmy)
    │       │   ├── lemmy_utils v0.19.5 (/home/xxx/git/lemmy/crates/utils)
    │       │   │   ├── lemmy_api v0.19.5 (/home/xxx/git/lemmy/crates/api) (*)
    │       │   │   ├── lemmy_api_common v0.19.5 (/home/xxx/git/lemmy/crates/api_common) (*)
    │       │   │   ├── lemmy_api_crud v0.19.5 (/home/xxx/git/lemmy/crates/api_crud) (*)
    │       │   │   ├── lemmy_apub v0.19.5 (/home/xxx/git/lemmy/crates/apub) (*)
    │       │   │   ├── lemmy_db_schema v0.19.5 (/home/xxx/git/lemmy/crates/db_schema) (*)
    │       │   │   ├── lemmy_db_views v0.19.5 (/home/xxx/git/lemmy/crates/db_views) (*)
    │       │   │   ├── lemmy_federate v0.19.5 (/home/xxx/git/lemmy/crates/federate) (*)
    │       │   │   ├── lemmy_routes v0.19.5 (/home/xxx/git/lemmy/crates/routes) (*)
    │       │   │   └── lemmy_server v0.19.5 (/home/xxx/git/lemmy)
    │       │   └── reqwest-tracing v0.4.8
    │       │       └── lemmy_server v0.19.5 (/home/xxx/git/lemmy)
    │       ├── reqwest-tracing v0.4.8 (*)
    │       └── webmention v0.5.0
    │           └── lemmy_api_crud v0.19.5 (/home/xxx/git/lemmy/crates/api_crud) (*)
    ├── reqwest v0.11.27 (*)
    └── tokio-native-tls v0.3.1
        ├── hyper-tls v0.5.0 (*)
        └── reqwest v0.11.27 (*)

@kwaa
Copy link
Contributor Author

kwaa commented Jul 16, 2024

@dessalines I think it's because rustls-tls feature was missed here.

reqwest = { version = "0.11.27", features = ["json", "blocking", "gzip"] }

Cargo.toml Show resolved Hide resolved
@kwaa
Copy link
Contributor Author

kwaa commented Jul 16, 2024

There may be other libraries using reqwest that do not enable the rustls-tls feature.

https://github.com/kwaa/lemmy/blob/854fee98e9f7481e0abebbc7405b271f8e7a4080/Cargo.lock#L4661

@kwaa
Copy link
Contributor Author

kwaa commented Jul 17, 2024

This may be due to the webmention library, which does not disable the default feature.

https://github.com/timmarinin/webmention/blob/main/Cargo.toml#L17

@dessalines
Copy link
Member

I'll do a PR there, but according to cargo tree above, there's a lot more that require it for some reason, including our own deps even (which I don't understand why).

@kwaa
Copy link
Contributor Author

kwaa commented Jul 17, 2024

I'll do a PR there, but according to cargo tree above, there's a lot more that require it for some reason, including our own deps even (which I don't understand why).

This should just be because they use the same version and openssl will be installed as long as one of them doesn't disable the default features.

@dessalines
Copy link
Member

dessalines commented Jul 17, 2024

@Nutomic I tried to look up how workspace dependencies work, and tried to add default-features = false to all our reqwest workspace deps, but it had no effect.

Apparently workspace dep features are additive only, so none of them should require the full features of reqwest, so I don't know why all our lemmy crates are requiring openssl.

@Nutomic
Copy link
Member

Nutomic commented Jul 18, 2024

Run cargo tree -i openssl --edges features to see which feature is enabled by which dependency. And so far the webmention dependency is unchanged, you can use a git dependency from your branch to test if its enough.

@dessalines
Copy link
Member

That did it, thx! Okay this is ready to merge now (as long as tests pass).

I guess the messy cargo trees just had to do with circulare dependencies.

@dessalines dessalines enabled auto-merge (squash) July 18, 2024 12:35
@dessalines dessalines merged commit 847c01f into LemmyNet:main Jul 18, 2024
1 check passed
@kwaa kwaa deleted the refactor/remove-openssl branch July 18, 2024 12:48
@Nutomic
Copy link
Member

Nutomic commented Jul 18, 2024

We shouldnt merge any git dependencies as that will break cargo publish which is part of ci.

@dessalines
Copy link
Member

dessalines commented Jul 18, 2024

Oops.. I'll just do a PR to change that one dependency back, and once @timmarinin merges my webmention PR, this will be handled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants