Fixes #39057

Change proposed :

I have added a toString() method in the implementations for SslBundle interface. There were two implementations : 1. PropertiesSslBundle 2. WebServerSslBundle

This toString() method prints the following attributes of the respective class: 1. alias of key 2. protocol 3. ciphers 4. enabledProtocols

Attaching a screenshot of the line printed when object is logged :

SpringBoot SslBundle implementations do not provide useful toString() results

Comment From: tkrah

What about keystore type, keystore location, truststore type and location, those would also be beneficial to know, no?

Comment From: amparab

What about keystore type, keystore location, truststore type and location, those would also be beneficial to know, no?

I have added keystore type and truststore type (if truststore is not null, otherwise it would throw NullPointerException) Printing the keystore and truststore location is little tricky, because the keystore and truststore has already been loaded at this point and it's path is not available.

Comment From: tkrah

What about keystore type, keystore location, truststore type and location, those would also be beneficial to know, no?

I have added keystore type and truststore type (if truststore is not null, otherwise it would throw NullPointerException) Printing the keystore and truststore location is little tricky, because the keystore and truststore has already been loaded at this point and it's path is not available.

Could you transport that location info (add it to the code) just for that purpose maybe?

Comment From: wilkinsona

Could you transport that location info (add it to the code) just for that purpose maybe?

That's a much broader and more complex change, particularly as some values can either be a location from which something is loaded or something inlined directly.

As a first pass, for this PR let's focus on the things that are readily available. We can then perhaps consider a second pass that does something more complex, possibly through implementation of the Origin interface.

Comment From: tkrah

Could you transport that location info (add it to the code) just for that purpose maybe?

That's a much broader and more complex change, particularly as some values can either be a location from which something is loaded or something inlined directly.

As a first pass, for this PR let's focus on the things that are readily available. We can then perhaps consider a second pass that does something more complex, possibly through implementation of the Origin interface.

Sounds good :)

Comment From: amparab

Thanks very much for the PR, @amparab.

There's a utility in Spring Framework, ToStringCreator, that we like to use for this sort of thing. Here's one existing example in Spring Boot's code of how it's used:

https://github.com/spring-projects/spring-boot/blob/4fa47aa5015b0d7374d47005e01ab5163af7fd03/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Bindable.java#L162-L170

Would you like to update your proposal to use it? Please don't worry if you don't have time, we can always take care of it as part of merging the change.

Hello @wilkinsona. I have updated the PR :-) Please let me know if any other changes.

Comment From: wilkinsona

@amparab thank you very much for making your first contribution to Spring Boot