(int build_mode, String[] args)
| 89 | * do_server() |
| 90 | */ |
| 91 | private void do_server(int build_mode, String[] args) |
| 92 | throws Exception |
| 93 | { |
| 94 | int i = 1; |
| 95 | int port = 4433; |
| 96 | int options = axtlsj.SSL_DISPLAY_CERTS; |
| 97 | boolean quiet = false; |
| 98 | String password = null; |
| 99 | String private_key_file = null; |
| 100 | |
| 101 | /* organise the cert/ca_cert lists */ |
| 102 | int cert_size = SSLUtil.maxCerts(); |
| 103 | int ca_cert_size = SSLUtil.maxCACerts(); |
| 104 | String[] cert = new String[cert_size]; |
| 105 | String[] ca_cert = new String[ca_cert_size]; |
| 106 | int cert_index = 0; |
| 107 | int ca_cert_index = 0; |
| 108 | |
| 109 | while (i < args.length) |
| 110 | { |
| 111 | if (args[i].equals("-accept")) |
| 112 | { |
| 113 | if (i >= args.length-1) |
| 114 | { |
| 115 | print_server_options(build_mode, args[i]); |
| 116 | } |
| 117 | |
| 118 | port = Integer.parseInt(args[++i]); |
| 119 | } |
| 120 | else if (args[i].equals("-quiet")) |
| 121 | { |
| 122 | quiet = true; |
| 123 | options &= ~(int)axtlsj.SSL_DISPLAY_CERTS; |
| 124 | } |
| 125 | else if (build_mode >= axtlsj.SSL_BUILD_SERVER_ONLY) |
| 126 | { |
| 127 | if (args[i].equals("-cert")) |
| 128 | { |
| 129 | if (i >= args.length-1 || cert_index >= cert_size) |
| 130 | { |
| 131 | print_server_options(build_mode, args[i]); |
| 132 | } |
| 133 | |
| 134 | cert[cert_index++] = args[++i]; |
| 135 | } |
| 136 | else if (args[i].equals("-key")) |
| 137 | { |
| 138 | if (i >= args.length-1) |
| 139 | { |
| 140 | print_server_options(build_mode, args[i]); |
| 141 | } |
| 142 | |
| 143 | private_key_file = args[++i]; |
| 144 | options |= axtlsj.SSL_NO_DEFAULT_KEY; |
| 145 | } |
| 146 | else if (args[i].equals("-pass")) |
| 147 | { |
| 148 | if (i >= args.length-1) |
no test coverage detected