Skip to content

Localhost and Pins Exception #25

Description

@jazzyjester

Hello, thank you for such great library.
I'm currently implementing it for our app,
Basically, it works.

But,
We have in
network_sec_config.xml - a localhost domain.
when running the app, the library throw exception :

    DomainValidator domainValidator = DomainValidator.getInstance(false);
    if (!domainValidator.isValid(hostname)) {
        throw new ConfigurationException("Tried to pin an invalid domain: " + hostname);
    }

@jobot0 Can you help please ?

I see that
DomainValidator domainValidator = DomainValidator.getInstance(false);
domainValidator is always inited with false, and thats why it fails in returning true
in returning allowLocal && hostnameRegex.isValid(domain)
because allowLocal is always false.

BTW, localhost sits inside different [domain-config]
without [pin-set] , and your library throws exception where no pins provided there.
I don't want pins there..

Thanks for the help...

Jazzy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions