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

SSL Configuration Fails even EnbleSsl property is set to false #6038

Conversation

aminchenkov
Copy link
Contributor

Fixes # #3594

Changes

If remote:dot-netty:enablessl property is set false and certificate and a password are not provided, a SslSettings object is still trying to be created.
After this change, SslSettings object will be attempted to create only if enablessl property is set to false.

@Aaronontheweb
Copy link
Member

Thanks @aminchenkov - I'll review this.

@Aaronontheweb
Copy link
Member

Looks like this PR broke some of the other tests in the affected file. Looking at that...

@Aaronontheweb
Copy link
Member

Ah, it's your own test that is failing

@Aaronontheweb
Copy link
Member

   at Akka.Remote.Tests.Transport.DotNettySslSupportSpec.If_EnableSsl_configuration_is_true_but_not_valid_certificate_password_is_provided_than_WindowsCryptographicException_should_be_thrown() in /home/vsts/work/1/s/src/core/Akka.Remote.Tests/Transport/DotNettySslSupportSpec.cs:line 253
--- End of stack trace from previous location where exception was thrown ---
Assert.Equal() Failure
          ↓ (pos 0)
Expected: The specified network password is not cor···
Actual:   error:23076071:PKCS12 routines:PKCS12_par···
          ↑ (pos 0)

@Aaronontheweb
Copy link
Member

Disabled the inner assertion around the exact error message. But otherwise, this PR looks good to me.

Copy link
Member

@Aaronontheweb Aaronontheweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Aaronontheweb Aaronontheweb enabled auto-merge (squash) July 11, 2022 14:16
@Aaronontheweb Aaronontheweb enabled auto-merge (squash) July 11, 2022 14:16
@Aaronontheweb
Copy link
Member

@Arkatufus we're going to need to backport this change to v1.4 as well.

@Aaronontheweb
Copy link
Member

Build failed due to a temporary NuGet.org failure. I'll re-run it.

@aminchenkov
Copy link
Contributor Author

aminchenkov commented Jul 11, 2022

@Aaronontheweb , what is next? I see it was approved, but when it will be merged? Can we expect it to release it soon?

@Aaronontheweb
Copy link
Member

@aminchenkov I'm making sure that those compilation issues (NuGet-related) have been resolved. Once that's done we'll backport this PR into the v1.4 branch and do a release soon. This week probably.

@ismaelhamed
Copy link
Member

We still need to check for config.HasPath("ssl")

@Aaronontheweb
Copy link
Member

We still need to check for config.HasPath("ssl")

You're right about that

@@ -87,7 +87,7 @@ public static DotNettyTransportSettings Create(Config config)
serverSocketWorkerPoolSize: ComputeWorkerPoolSize(config.GetConfig("server-socket-worker-pool")),
clientSocketWorkerPoolSize: ComputeWorkerPoolSize(config.GetConfig("client-socket-worker-pool")),
maxFrameSize: ToNullableInt(config.GetByteSize("maximum-frame-size", null)) ?? 128000,
ssl: config.HasPath("ssl") ? SslSettings.Create(config.GetConfig("ssl")) : SslSettings.Empty,
ssl: config.HasPath("ssl") && config.GetBoolean("enable-ssl", false) ? SslSettings.Create(config.GetConfig("ssl")) : SslSettings.Empty,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should address your issue @ismaelhamed

Copy link
Member

@ismaelhamed ismaelhamed Jul 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enableSsl && config.HasPath("ssl") can be achieved by moving line #81 outside the return, but otherwise LGTM.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ismaelhamed , I pushed the change. Please check if it is what you wanted.

auto-merge was automatically disabled July 12, 2022 15:52

Head branch was pushed to by a user without write access

Copy link
Member

@Aaronontheweb Aaronontheweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Aaronontheweb Aaronontheweb enabled auto-merge (squash) July 12, 2022 15:55
@Aaronontheweb Aaronontheweb merged commit b21f5fa into akkadotnet:dev Jul 13, 2022
Aaronontheweb added a commit that referenced this pull request Jul 18, 2022
…t to false (#6043)

* SSL Configuration Fails even EnbleSsl property is set to false (#6038)

* Respect EnableSsl configuration propert

* Update DotNettySslSupportSpec.cs

* Update DotNettySslSupportSpec.cs

* Update DotNettyTransportSettings.cs

* Moved enableSsl variable initialization outside return statement

Co-authored-by: Aliaksei Minchankou <Aliaksei.Minchankou@nreca.coop>
Co-authored-by: Aaron Stannard <aaron@petabridge.com>

* SSL

* (Parameter 'certificatePath')

* TestKit

* Fixed up assertion to no longer be whitespace sensitive

* [Bug] using FluentAssertions;

Co-authored-by: aminchenkov <alexei.minchenkov@gmail.com>
Co-authored-by: Aliaksei Minchankou <Aliaksei.Minchankou@nreca.coop>
Co-authored-by: Aaron Stannard <aaron@petabridge.com>
@aminchenkov
Copy link
Contributor Author

@Aaronontheweb, I upgraded our project to use 1.40 and 1.39 and our application is broken. We use Ask/Tell pattern to communicate between nodes and this does not work anymore - message does not send. Any ideas why it might happen?
Working version is "1.4.16".

@aminchenkov
Copy link
Contributor Author

I see in logs (EnableSsl is true):
heartbeat interval is growing too large for address akka.ssl.tcp://RsPlatformServiceSystem@localhost:60841: 2018 millis

@aminchenkov
Copy link
Contributor Author

Custer is formed correctly with all required nodes.

@Aaronontheweb
Copy link
Member

Glad to hear it

@aminchenkov
Copy link
Contributor Author

aminchenkov commented Jul 25, 2022

Glad to hear it

@Aaronontheweb , it is actually not good for us - we cannot use latest libraries. do you know what might be the root cause of why a message cannot be sent remotely anymore even the cluster is formed? The issue in 1.14.39 as well.

@Aaronontheweb
Copy link
Member

I missed your earlier comments - no idea. I'm at a conference and can only see messages on my mobile. I recommend filing an issue.

@Aaronontheweb
Copy link
Member

Also, going to need a lot more information (logs.) Strongly recommend you diff the releases on GitHub and identify where a change could have affected you. We have tons of users running 1.4.39 without issue.

@Aaronontheweb
Copy link
Member

I upgraded our project to use 1.40 and 1.39 and our application is broken. We use Ask/Tell pattern to communicate between nodes and this does not work anymore - message does not send. Any ideas why it might happen?
Working version is "1.4.16".

There's no reason why Akka.NET wouldn't allow an outbound message to be sent - if Akka.Remote / Akka.Cluster are still functioning normally then the issue isn't remoting / clustering. It's probably your application code and possibly the way we changed how Ask is implemented internally (modernized it to use async Task local functions rather than ContinueWith - should be totally benign unless you are doing weird stuff with async context - diff the release notes.)

@aminchenkov
Copy link
Contributor Author

Thank you. Will try to find the root cause. Will keep you posted.

@aminchenkov
Copy link
Contributor Author

It is release 1.4.24. 23 works fine, Reading release notes. @Aaronontheweb , if you already know what might be the reason - please reply

@aminchenkov
Copy link
Contributor Author

Last logging warning before nothing: "heartbeat interval is growing too large for address"

@aminchenkov
Copy link
Contributor Author

aminchenkov commented Jul 27, 2022

@Aaronontheweb , in 23 the code below returns 1 routee but in 1.24 it returns empty list. Do you have an idea why it might be. We are using deployment.

            var task = RspActorSystem.RsDataValidationActor.Ask<Routees>(GetRoutees.Instance).ContinueWith(tr =>
            {
                var members = tr.Result.Members.ToList();
                return members;
            });

@aminchenkov
Copy link
Contributor Author

@Aaronontheweb , in 23 the code below returns 1 routee but in 1.24 it returns empty list. Do you have an idea why it might be. We are using deployment.

            var task = RspActorSystem.RsDataValidationActor.Ask<Routees>(GetRoutees.Instance).ContinueWith(tr =>
            {
                var members = tr.Result.Members.ToList();
                return members;
            });

Sorry, now it return 1 as well.

@Aaronontheweb
Copy link
Member

So release v1.4.24 works without any issues now too?

@aminchenkov
Copy link
Contributor Author

No. 1.24 does not work even a routee is resolved.

@Aaronontheweb
Copy link
Member

Here's everything that occurred in v1.4.24 https://github.com/akkadotnet/akka.net/releases/tag/1.4.24 - the only issue I can think of that would affect you is the transmission of unsafe types in Hyperion was disallowed then. Does that apply to you?

@aminchenkov
Copy link
Contributor Author

aminchenkov commented Jul 27, 2022

@Aaronontheweb , I don't know how I can answer to your question. We send in messages between nodes only integers and strings.

@Aaronontheweb
Copy link
Member

That'd be a "no" then - Hyperion doesn't filter out primitives. You should probably just message us in Discord because in order for us to help you you're going to need to share logs / config. Whatever is going on is specific to your application.

@aminchenkov
Copy link
Contributor Author

@Aaronontheweb , do you already have a Discord Server?

@Aaronontheweb
Copy link
Member

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

Successfully merging this pull request may close these issues.

3 participants