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

[client] networkconfig address validation missing #11242

Closed
pveentjer opened this issue Aug 27, 2017 · 2 comments
Closed

[client] networkconfig address validation missing #11242

pveentjer opened this issue Aug 27, 2017 · 2 comments

Comments

@pveentjer
Copy link
Contributor

@pveentjer pveentjer commented Aug 27, 2017

The following program runs fine even though no valid address has been added.

public class Main {

    public static void main(String[] args){
        HazelcastInstance server = Hazelcast.newHazelcastInstance();

        ClientConfig clientConfig = new ClientConfig();
        clientConfig.getNetworkConfig().addAddress("");

        HazelcastInstance client = HazelcastClient.newHazelcastClient(clientConfig);
        System.out.println(client.getAtomicLong("foo").incrementAndGet());
    }
}

So we violate fail-fast.

We should check if the passed address is a valid ip address or hostname.

@pveentjer pveentjer added this to the 3.8.6 milestone Aug 28, 2017
@sancar sancar self-assigned this Sep 7, 2017
@sancar
Copy link
Member

@sancar sancar commented Sep 7, 2017

I am planning to add only check for empty string as it is done on server. Server does not do any further validation.
@pveentjer
Checking if Ipv4 and Ipv6 format is straightforward but how are we gonna check if it is a valid hostname ?

@pveentjer
Copy link
Contributor Author

@pveentjer pveentjer commented Sep 7, 2017

We should at least check for empty string (after trimming).

sancar added a commit to sancar/hazelcast that referenced this issue Sep 11, 2017
sancar added a commit to sancar/hazelcast that referenced this issue Sep 11, 2017
sancar added a commit to sancar/hazelcast that referenced this issue Sep 12, 2017
sancar added a commit to sancar/hazelcast that referenced this issue Sep 12, 2017
sancar added a commit to sancar/hazelcast that referenced this issue Sep 12, 2017
sancar added a commit to sancar/hazelcast that referenced this issue Sep 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants