This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ballerina/http; | |
http:Client clientEP = check new("https://localhost:9092", | |
secureSocket = { | |
cert: "/path/to/client-public.crt", | |
key: { | |
certFile: "/path/to/server-public.crt", | |
keyFile: "/path/to/server-private.key" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ballerina/http; | |
listener http:Listener listenerEP = new(9091, | |
secureSocket = { | |
key: { | |
certFile: "/path/to/server-public.crt", | |
keyFile: "/path/to/server-private.key" | |
}, | |
mutualSsl: { | |
verifyClient: http:REQUIRE, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ballerina/grpc; | |
GrpcClient clientEP = check new("https://localhost:9191", | |
auth = { | |
issuer: "order-service", | |
audience: ["payment-service", "delivery-service"], | |
keyId: "5a0b754-895f-4279-8843-b745e11a57e9", | |
jwtId: "JlbmMiOiJBMTI4Q0JDLUhTMjU2In", | |
customClaims: { "scp": "admin" }, | |
expTime: 3600, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ballerina/grpc; | |
import ballerina/jwt; | |
listener grpc:Listener paymentsEP = new(9191, | |
secureSocket = { | |
key: { | |
certFile: "/path/to/public.crt", | |
keyFile: "/path/to/private.key" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ballerina/http; | |
http:Client webAppClient = check new("https://localhost:9090", | |
auth = { | |
tokenUrl: "https://localhost:9443/oauth2/token", | |
clientId: "FlfJYKBD2c925h4lkycqNZlC2l4a", | |
clientSecret: "PJz0UhTJMrHOo68QQNpvnqAY_3Aa", | |
scopes: ["customer"], | |
clientConfig: { | |
secureSocket: { |
OlderNewer