public void TestCheckGrpcUrlInvalid() { // Test a number of invalid variations Assert.IsNotNull(Utils.CheckGrpcUrl("http://hyperledger.org:1234")); Assert.IsNotNull(Utils.CheckGrpcUrl("grpc://hyperledger.org")); Assert.IsNotNull("grpc://hyperledger.org:1234/index.html"); }
private string GrpcTLSify(string location) { location = location.Trim(); System.Exception e = Utils.CheckGrpcUrl(location); if (e != null) { throw new System.Exception($"Bad TEST parameters for grpc url {location}"); } return(runningFabricTLS ? Regex.Replace(location, "^grpc://", "grpcs://") : location); }
public BaseClient(string name, string url, Properties properties) { if (string.IsNullOrEmpty(name)) { throw new ArgumentException("Invalid name"); } Exception e = Utils.CheckGrpcUrl(url); if (e != null) { throw new ArgumentException("Bad url.", e); } Url = url; Name = name; Properties = properties?.Clone(); }
public void TestCheckGrpcUrlValid() { // Test a number of valid variations Assert.IsNull(Utils.CheckGrpcUrl("grpc://hyperledger.org:1234")); Assert.IsNull(Utils.CheckGrpcUrl("grpcs://127.0.0.1:1234")); }