Skip to content

Instantly share code, notes, and snippets.

View ldclakmal's full-sized avatar
🎯
Focusing

Chanaka Lakmal ldclakmal

🎯
Focusing
View GitHub Profile
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"
}
}
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,
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,
import ballerina/grpc;
import ballerina/jwt;
listener grpc:Listener paymentsEP = new(9191,
secureSocket = {
key: {
certFile: "/path/to/public.crt",
keyFile: "/path/to/private.key"
}
}
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: {