host[256], /* Hostname */
userpass[256], /* Username/password */
resource[256]; /* Resource path */
- int tls_options = _HTTP_TLS_NONE,
+ int af = AF_UNSPEC, /* Address family */
+ tls_options = _HTTP_TLS_NONE,
/* TLS options */
verbose = 0; /* Verbosity */
ipp_t *request, /* IPP Get-Printer-Attributes request */
{
verbose = 1;
}
+ else if (!strcmp(argv[i], "-4"))
+ {
+ af = AF_INET;
+ }
+ else if (!strcmp(argv[i], "-6"))
+ {
+ af = AF_INET6;
+ }
else if (argv[i][0] == '-')
{
printf("tlscheck: Unknown option '%s'.\n", argv[i]);
_httpTLSSetOptions(tls_options);
- http = httpConnect2(server, port, NULL, AF_UNSPEC, HTTP_ENCRYPTION_ALWAYS, 1, 30000, NULL);
+ http = httpConnect2(server, port, NULL, af, HTTP_ENCRYPTION_ALWAYS, 1, 30000, NULL);
if (!http)
{
printf("%s: ERROR (%s)\n", server, cupsLastErrorString());
puts(" --no-tls10 Disable TLS/1.0");
puts(" --rc4 Allow RC4 encryption");
puts(" --verbose Be verbose");
+ puts(" -4 Connect using IPv4 addresses only");
+ puts(" -6 Connect using IPv6 addresses only");
puts(" -v Be verbose");
puts("");
puts("The default port is 631.");