Signed-off-by: Felix Fietkau <nbd@openwrt.org>
#include <unistd.h>
#include <stdio.h>
#include <dlfcn.h>
#include <unistd.h>
#include <stdio.h>
#include <dlfcn.h>
#include <libubox/blobmsg.h>
#include <libubox/blobmsg.h>
+enum {
+ L_NO_CHECK_CERTIFICATE,
+};
+
+static const struct option longopts[] = {
+ [L_NO_CHECK_CERTIFICATE] = { "no-check-certificate", no_argument }
+};
int main(int argc, char **argv)
{
int main(int argc, char **argv)
{
struct uclient *cl;
bool verify = true;
int ch;
struct uclient *cl;
bool verify = true;
int ch;
- while ((ch = getopt(argc, argv, "Cc:")) != -1) {
+ while ((ch = getopt_long(argc, argv, "c:", longopts, &longopt_idx)) != -1) {
+ case 0:
+ switch (longopt_idx) {
+ case L_NO_CHECK_CERTIFICATE:
+ verify = false;
+ break;
+ default:
+ return usage(progname);
+ }
case 'c':
if (ssl_ctx)
ssl_ops->context_add_ca_crt_file(ssl_ctx, optarg);
break;
case 'c':
if (ssl_ctx)
ssl_ops->context_add_ca_crt_file(ssl_ctx, optarg);
break;
- case 'C':
- verify = false;
- break;
default:
return usage(progname);
}
default:
return usage(progname);
}