Skip to content

Example Configuring Conscrypting on non Android #5737

@yeshwanthvshenoy

Description

@yeshwanthvshenoy

What version of gRPC are you using?

1.20.0

What did you expect to see?

Some example where conscrypting is put to use. Other parts of documentation like are good compared to this. I am using example-tls as base but I not pretty sure where the line Security.insertProviderAt(Conscrypt.newProvider(), 1); goes and if there is anyother changes that are needed.

EDIT:

public static void main(String[] args) throws IOException, InterruptedException {

        if (args.length < 4 || args.length > 5) {
            System.out.println(
                    "USAGE: HelloWorldServerTls host port certChainFilePath privateKeyFilePath " +
                    "[trustCertCollectionFilePath]\n  Note: You only need to supply trustCertCollectionFilePath if you want " +
                    "to enable Mutual TLS.");
            System.exit(0);
        }

        final HelloWorldServerTls server = new HelloWorldServerTls(args[0],
                Integer.parseInt(args[1]),
                args[2],
                args[3],
                args.length == 5 ? args[4] : null);
        Security.insertProviderAt(Conscrypt.newProvider(), 1);
        server.start();
        server.blockUntilShutdown();
}

Is this enough if I add that Security.insertProviderAt(Conscrypt.newProvider(), 1); over there and just add the conscrypt gradle dependency? Is there something else I need to do?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions