-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAdvanced_VPN_OpenVPN.asp
1607 lines (1606 loc) · 63.8 KB
/
Advanced_VPN_OpenVPN.asp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html xmlns:v>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta HTTP-EQUIV="Expires" CONTENT="-1">
<link rel="shortcut icon" href="images/favicon.png">
<link rel="icon" href="images/favicon.png">
<title><#548#> - <#55#></title>
<link rel="stylesheet" type="text/css" href="index_style.css">
<link rel="stylesheet" type="text/css" href="form_style.css">
<link rel="stylesheet" type="text/css" href="menu_style.css">
<script language="JavaScript" type="text/javascript" src="/help.js"></script>
<script language="JavaScript" type="text/javascript" src="/state.js"></script>
<script language="JavaScript" type="text/javascript" src="/general.js"></script>
<script language="JavaScript" type="text/javascript" src="/popup.js"></script>
<script type="text/javascript" language="JavaScript" src="/merlin.js"></script>
<script language="JavaScript" type="text/javascript" src="/validator.js"></script>
<script type="text/javascript" src="/js/jquery.js"></script>
<script type="text/javascript" src="/switcherplugin/jquery.iphone-switch.js"></script>
<script language="JavaScript" type="text/javascript" src="/form.js"></script>
<style type="text/css">
.contentM_qis{
width:740px;
margin-top:280px;
margin-left:380px;
position:absolute;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
z-index:200;
background-color:#2B373B;
box-shadow: 3px 3px 10px #000;
display:none;
/*behavior: url(/PIE.htc);*/
}
.QISform_wireless{
width:600px;
font-size:12px;
color:#FFFFFF;
margin-top:10px;
*margin-left:10px;
}
.QISform_wireless th{
padding-left:10px;
*padding-left:30px;
font-size:12px;
font-weight:bolder;
color: #FFFFFF;
text-align:left;
}
.description_down{
margin-top:10px;
margin-left:10px;
padding-left:5px;
font-weight:bold;
line-height:140%;
color:#ffffff;
}
</style>
<script>
window.onresize = function() {
if(document.getElementById("tlsKey_panel").style.display == "block") {
cal_panel_block("tlsKey_panel", 0.15);
}
}
<% wanlink(); %>
<% vpn_server_get_parameter(); %>;
var vpn_server_clientlist_array_ori = '<% nvram_char_to_ascii("","vpn_serverx_clientlist"); %>';
var vpn_server_clientlist_array = decodeURIComponent(vpn_server_clientlist_array_ori);
var openvpn_unit = '<% nvram_get("vpn_server_unit"); %>';
var vpn_server_mode = 'openvpn'; // Hardcoded for this page, as we support both simultaneously
var openvpn_eas = '<% nvram_get("vpn_serverx_start"); %>';
var vpn_server_enable = (openvpn_eas.indexOf(''+(openvpn_unit)) >= 0) ? "1" : "0";
var service_state = "";
if (openvpn_unit == '1')
service_state = '<% nvram_get("vpn_server1_state"); %>';
else if (openvpn_unit == '2')
service_state = '<% nvram_get("vpn_server2_state"); %>';
else
service_state = false;
var openvpnd_connected_clients = [];
var openvpn_clientlist_array = decodeURIComponent('<% nvram_char_to_ascii("", "vpn_server_ccd_val"); %>');
var ciphersarray = [
["AES-128-CBC"],
["AES-192-CBC"],
["AES-256-CBC"],
["BF-CBC"],
["CAST5-CBC"],
["CAMELLIA-128-CBC"],
["CAMELLIA-192-CBC"],
["CAMELLIA-256-CBC"],
["DES-CBC"],
["DES-EDE-CBC"],
["DES-EDE3-CBC"],
["DESX-CBC"],
["IDEA-CBC"],
["RC2-40-CBC"],
["RC2-64-CBC"],
["RC2-CBC"],
["RC5-CBC"],
["SEED-CBC"]
];
var digestsarray = [
["DSA"],
["DSA-SHA"],
["DSA-SHA1"],
["DSA-SHA1-old"],
["ecdsa-with-SHA1"],
["MD4"],
["MD5"],
["MDC2"],
["RIPEMD160"],
["RSA-MD4"],
["RSA-MD5"],
["RSA-MDC2"],
["RSA-RIPEMD160"],
["RSA-SHA"],
["RSA-SHA1"],
["RSA-SHA1-2"],
["RSA-SHA224"],
["RSA-SHA256"],
["RSA-SHA384"],
["RSA-SHA512"],
["SHA"],
["SHA1"],
["SHA224"],
["SHA256"],
["SHA384"],
["SHA512"],
["whirlpool"]
];
function initial(){
var currentcipher = "<% nvram_get("vpn_server_cipher"); %>";
var currentdigest = "<% nvram_get("vpn_server_digest"); %>";
show_menu();
addOnlineHelp(document.getElementById("faq"), ["ASUSWRT", "VPN"]);
formShowAndHide(vpn_server_enable, "openvpn");
if(realip_support){
if(!external_ip){
document.getElementById("privateIP_notes").innerHTML = "<#2184#>"
document.getElementById("privateIP_notes").style.display = "";
}
}
else if(validator.isPrivateIP(wanlink_ipaddr())){
document.getElementById("privateIP_notes").innerHTML = "<#2184#>"
document.getElementById("privateIP_notes").style.display = "";
}
/*Advanced Setting start */
allowed_openvpn_clientlist();
add_option(document.form.vpn_server_cipher, "Default","default",(currentcipher == "default"));
add_option(document.form.vpn_server_cipher, "None","none",(currentcipher == "none"));
for(var i = 0; i < ciphersarray.length; i += 1){
add_option(document.form.vpn_server_cipher, ciphersarray[i][0], ciphersarray[i][0], (currentcipher == ciphersarray[i][0]));
}
add_option(document.form.vpn_server_digest, "Default","default",(currentdigest == "default"));
add_option(document.form.vpn_server_digest, "None","none",(currentdigest == "none"));
for(var i = 0; i < digestsarray.length; i += 1){
add_option(document.form.vpn_server_digest, digestsarray[i][0], digestsarray[i][0], (currentdigest == digestsarray[i][0]));
}
document.form.VPNServer_enable.value = vpn_server_enable;
setRadioValue(document.form.vpn_server_x_dns, ((document.form.vpn_serverx_dns.value.indexOf(''+(openvpn_unit)) >= 0) ? "1" : "0"));
updateCRTValue();
update_visibility();
/*Advanced Setting end */
}
function formShowAndHide(server_enable, server_type) {
if(server_enable == 1){
document.getElementById("trVPNServerMode").style.display = "";
document.getElementById("selSwitchMode").value = "1";
document.getElementById('openvpn_export').style.display = "";
document.getElementById('OpenVPN_setting').style.display = "";
document.getElementById("divAdvanced").style.display = "none";
if(vpn_server_enable == '0')
document.getElementById('openvpn_export').style.display = "none";
else
document.getElementById('openvpn_export').style.display = "";
if(service_state == false || service_state != '2')
document.getElementById('export_div').style.display = "none";
if(!email_support)
document.getElementById('exportViaEmail').style.display = "none";
showopenvpnd_clientlist();
update_vpn_client_state();
openvpnd_connected_status();
check_vpn_server_state();
document.getElementById("divApply").style.display = "";
}
else{
document.getElementById("trVPNServerMode").style.display = "none";
document.getElementById("openvpn_export").style.display = "none";
document.getElementById("OpenVPN_setting").style.display = "none";
document.getElementById("divAdvanced").style.display = "none";
}
}
function openvpnd_connected_status(){
var rule_num = document.getElementById("openvpnd_clientlist_table").rows.length;
var username_status = "";
for(var x=0; x < rule_num; x++){
var ind = x;
username_status = "conn"+ind;
if(openvpnd_connected_clients.length >0){
if(document.getElementById(username_status)) {
document.getElementById(username_status).innerHTML = '<#89#>';
}
for(var y=0; y<openvpnd_connected_clients.length; y++){
if(document.getElementById("openvpnd_clientlist_table").rows[x].cells[1].title == openvpnd_connected_clients[y].username){
document.getElementById(username_status).innerHTML = '<a class="hintstyle2" href="javascript:void(0);" onClick="showOpenVPNClients(\''+openvpnd_connected_clients[y].username+'\');"><#67#></a>';
break;
}
}
}else if(document.getElementById(username_status)){
document.getElementById(username_status).innerHTML = '<#89#>';
}
}
}
function applyRule(){
var confirmFlag = true;
/* Advanced setting start */
var check_openvpn_conflict = function () { //if conflict with LAN ip & DHCP ip pool & static
var origin_lan_ip = '<% nvram_get("lan_ipaddr"); %>';
var lan_ip_subnet = origin_lan_ip.split(".")[0]+"."+origin_lan_ip.split(".")[1]+"."+origin_lan_ip.split(".")[2]+".";
var lan_ip_end = parseInt(origin_lan_ip.split(".")[3]);
var pool_start = '<% nvram_get("dhcp_start"); %>';
var pool_end = '<% nvram_get("dhcp_end"); %>';
var dhcp_staticlists = '<% nvram_get("dhcp_staticlist"); %>';
var staticclist_row = dhcp_staticlists.split('<');
var netmask_obj = document.form.vpn_server_nm;
var vpnSubnet = document.form.vpn_server_sn;
var pool_start = '<% nvram_get("dhcp_start"); %>';
var pool_subnet = pool_start.split(".")[0]+"."+pool_start.split(".")[1]+"."+pool_start.split(".")[2]+".";
if(document.form.vpn_server_if.value == 'tun'){
if(vpnSubnet.value == ""){
alert("<#140#>");
vpnSubnet.focus();
vpnSubnet.select();
return false;
}
if(!validator.ipRange(vpnSubnet, "")){
vpnSubnet.focus();
vpnSubnet.select();
return false;
}
var openvpn_server_subnet = vpnSubnet.value.split(".")[0]
+ "." + vpnSubnet.value.split(".")[1]
+ "." + vpnSubnet.value.split(".")[2]
+ ".";
if(origin_lan_ip == vpnSubnet.value) {
alert("<#2131#> " + origin_lan_ip);
vpnSubnet.focus();
vpnSubnet.select();
return false;
}
if(lan_ip_subnet == openvpn_server_subnet) {
alert("<#2129#>"+pool_start+" ~ "+pool_end);
vpnSubnet.focus();
vpnSubnet.select();
return false;
}
if(!validator.maskRange("255.255.0.0", "255.255.255.248", netmask_obj.value)) {
alert("Netmask range must be 255.255.0.0 (/16) ~ 255.255.255.248 (/29)");
netmask_obj.focus();
netmask_obj.select();
return false;
}
if(!validator.subnetAndMaskCombination(vpnSubnet.value, netmask_obj.value)) {
alert(vpnSubnet.value + " / " + netmask_obj.value + " combination is invalid");
vpnSubnet.focus();
vpnSubnet.select();
return false;
}
}
else if(document.form.vpn_server_if.value == 'tap' && document.form.vpn_server_dhcp.value == '0'){
if(!validator.isLegalIP(document.form.vpn_server_r1, "")){
document.form.vpn_server_r1.focus();
document.form.vpn_server_r1.select();
return false;
}
if(document.form.vpn_server_r1.value.split(".")[3] == 255){ //*.*.*.255 can't be IP in the IP pool
alert(document.form.vpn_server_r1.value + " <#149#>");
document.form.vpn_server_r1.focus();
document.form.vpn_server_r1.select();
return false;
}
if(!validator.isLegalIP(document.form.vpn_server_r2, "")){
document.form.vpn_server_r2.focus();
document.form.vpn_server_r2.select();
return false;
}
if(document.form.vpn_server_r2.value.split(".")[3] == 255){ //*.*.*.255 can't be IP in the IP pool
alert(document.form.vpn_server_r2.value + " <#149#>");
document.form.vpn_server_r2.focus();
document.form.vpn_server_r2.select();
return false;
}
var openvpn_clients_start_subnet = document.form.vpn_server_r1.value.split(".")[0] + "."
+ document.form.vpn_server_r1.value.split(".")[1] + "."
+ document.form.vpn_server_r1.value.split(".")[2] + ".";
var openvpn_clients_end_subnet = document.form.vpn_server_r2.value.split(".")[0] + "."
+ document.form.vpn_server_r2.value.split(".")[1] + "."
+ document.form.vpn_server_r2.value.split(".")[2] + ".";
var openvpn_clients_start_ip = parseInt(document.form.vpn_server_r1.value.split(".")[3]);
var openvpn_clients_end_ip = parseInt(document.form.vpn_server_r2.value.split(".")[3]);
if( (lan_ip_subnet == openvpn_clients_start_subnet || lan_ip_subnet == openvpn_clients_end_subnet)
&& (lan_ip_end >= openvpn_clients_start_ip && lan_ip_end <= openvpn_clients_end_ip)) {
alert("<#2131#> "+origin_lan_ip);
document.form.vpn_server_r1.focus();
document.form.vpn_server_r1.select();
return false;
}
if(openvpn_clients_end_ip < openvpn_clients_start_ip){
alert(document.form.vpn_server_r2.value + " <#149#>");
document.form.vpn_server_r2.focus();
document.form.vpn_server_r2.select();
return false;
}
if(pool_subnet != openvpn_clients_start_subnet) {
alert(document.form.vpn_server_r1.value + " <#149#>");
document.form.vpn_server_r1.focus();
document.form.vpn_server_r1.select();
return false;
}
if(pool_subnet != openvpn_clients_end_subnet) {
alert(document.form.vpn_server_r2.value + " <#149#>");
document.form.vpn_server_r2.focus();
document.form.vpn_server_r2.select();
return false;
}
if(dhcp_staticlists != "") {
for(var i = 1; i < staticclist_row.length; i +=1 ) {
var static_ip = staticclist_row[i].split('>')[1];
var static_subnet = static_ip.split(".")[0]+"."+static_ip.split(".")[1]+"."+static_ip.split(".")[2]+".";
var static_end = parseInt(static_ip.split(".")[3]);
if(static_subnet != openvpn_clients_start_subnet) {
alert(document.form.vpn_server_r1.value + " <#149#>");
document.form.vpn_server_r1.focus();
document.form.vpn_server_r1.select();
return false;
}
if(static_subnet != openvpn_clients_end_subnet) {
alert(document.form.vpn_server_r2.value + " <#149#>");
document.form.vpn_server_r2.focus();
document.form.vpn_server_r2.select();
return false;
}
}
}
}
return true;
};
/* Advanced setting end */
if(confirmFlag && check_openvpn_conflict() ) {
document.openvpnTLSKeyForm.vpn_crt_server1_ca.disabled = true;
document.openvpnTLSKeyForm.vpn_crt_server1_crt.disabled = true;
document.openvpnTLSKeyForm.vpn_crt_server1_key.disabled = true;
document.openvpnTLSKeyForm.vpn_crt_server1_dh.disabled = true;
document.openvpnTLSKeyForm.vpn_crt_server1_crl.disabled = true;
document.openvpnTLSKeyForm.vpn_crt_server1_extra.disabled = true;
document.openvpnTLSKeyForm.vpn_crt_server1_static.disabled = true;
document.openvpnTLSKeyForm.vpn_crt_server2_ca.disabled = true;
document.openvpnTLSKeyForm.vpn_crt_server2_crt.disabled = true;
document.openvpnTLSKeyForm.vpn_crt_server2_key.disabled = true;
document.openvpnTLSKeyForm.vpn_crt_server2_dh.disabled = true;
document.openvpnTLSKeyForm.vpn_crt_server2_crl.disabled = true;
document.openvpnTLSKeyForm.vpn_crt_server2_static.disabled = true;
document.openvpnTLSKeyForm.vpn_crt_server2_extra.disabled = true;
var get_group_value = function () {
var rule_num = document.getElementById("openvpnd_clientlist_table").rows.length;
var item_num = document.getElementById("openvpnd_clientlist_table").rows[0].cells.length;
var tmp_value = "";
for(var i = 1; i < rule_num; i += 1) {
tmp_value += "<"
for(var j = 1; j < item_num - 1; j += 1) {
if (j == 2) { // Password
tmp_value += overlib_str3[i];
}
else if(document.getElementById("openvpnd_clientlist_table").rows[i].cells[j].innerHTML.lastIndexOf("...") < 0) {
tmp_value += document.getElementById("openvpnd_clientlist_table").rows[i].cells[j].innerHTML;
}
else {
tmp_value += document.getElementById("openvpnd_clientlist_table").rows[i].cells[j].title;
}
if(j != item_num - 2)
tmp_value += ">";
}
}
if(tmp_value == "<"+"<#1324#>" || tmp_value == "<")
tmp_value = "";
return tmp_value;
};
if (service_state) {
document.form.action_script.value = "restart_vpnserver" + openvpn_unit;
}
if(document.form.VPNServer_enable.value == "1") {
document.form.VPNServer_mode.value = 'openvpn';
document.form.action_script.value = "restart_chpass;restart_vpnserver" + openvpn_unit;
document.form.vpn_serverx_clientlist.value = get_group_value();
/* Advanced setting start */
if(document.getElementById("server_reneg").style.display == "none")
document.form.vpn_server_reneg.disabled = true;
var getAdvancedValue = function () {
var client_num = document.getElementById("openvpn_clientlist_table").rows.length;
var item_num = document.getElementById("openvpn_clientlist_table").rows[0].cells.length;
var tmp_value = "";
for(var i = 0; i < client_num; i += 1) {
tmp_value += "<1>";
for(var j = 0; j < item_num - 1; j += 1) {
if (j == 3)
tmp_value += (document.getElementById("openvpn_clientlist_table").rows[i].cells[j].innerHTML == "Yes" ? 1 : 0);
else
tmp_value += document.getElementById("openvpn_clientlist_table").rows[i].cells[j].innerHTML;
if(j != item_num - 2)
tmp_value += ">";
}
}
if(tmp_value == "<"+"<#1324#>" || tmp_value == "<1>")
tmp_value = "";
document.form.vpn_server_ccd_val.value = tmp_value;
tmp_value = "";
for (var i = 1; i < 3; i += 1) {
if (i == openvpn_unit) {
if (getRadioValue(document.form.vpn_server_x_dns) == 1)
tmp_value += ""+i+",";
} else {
if (document.form.vpn_serverx_dns.value.indexOf(''+(i)) >= 0)
tmp_value += ""+i+","
}
}
if (tmp_value != document.form.vpn_serverx_dns.value) {
document.form.action_script.value += ";restart_dnsmasq";
document.form.vpn_serverx_dns.value = tmp_value;
}
}();
/* Advanced setting end */
}
else { //disable server
document.form.action_script.value = "stop_vpnserver" + openvpn_unit;
document.form.vpn_serverx_clientlist.value = get_group_value();
}
showLoading();
document.form.submit();
}
}
function addRow(obj, head){
if(head == 1)
vpn_server_clientlist_array += "<" /*<*/
else
vpn_server_clientlist_array += ">" /*>*/
vpn_server_clientlist_array += obj.value;
obj.value = "";
}
function validForm(){
var valid_username = document.form.vpn_server_clientlist_username;
var valid_password = document.form.vpn_server_clientlist_password;
if(valid_username.value == "") {
alert("<#140#>");
valid_username.focus();
return false;
}
else if(!Block_chars(valid_username, [" ", "@", "*", "+", "|", ":", "?", "<", ">", ",", ".", "/", ";", "[", "]", "\\", "=", "\"", "&" ])) {
return false;
}
if(valid_password.value == "") {
alert("<#140#>");
valid_password.focus();
return false;
}
else if(!Block_chars(valid_password, ["<", ">", "&"])) {
return false;
}
return true;
}
function addRow_Group(upper){
var username_obj = document.form.vpn_server_clientlist_username;
var password_obj = document.form.vpn_server_clientlist_password;
var rule_num = document.getElementById("openvpnd_clientlist_table").rows.length;
var item_num = document.getElementById("openvpnd_clientlist_table").rows[0].cells.length;
if(rule_num >= upper + 1) {
alert("<#1369#> " + upper + " <#1370#>");
return false;
}
if(validForm()){
if(item_num >= 2) {
for(var i = 0; i < rule_num; i += 1) {
if(username_obj.value == document.getElementById("openvpnd_clientlist_table").rows[i].cells[1].title) {
alert("<#1363#>");
username_obj.focus();
username_obj.select();
return false;
}
}
}
addRow(username_obj ,1);
addRow(password_obj, 0);
showopenvpnd_clientlist();
openvpnd_connected_status();
}
}
function del_Row(rowdata){
var i = rowdata.parentNode.parentNode.rowIndex;
document.getElementById("openvpnd_clientlist_table").deleteRow(i);
overlib_str3.splice(i,1);
var vpn_server_clientlist_value = "";
var rowLength = document.getElementById("openvpnd_clientlist_table").rows.length;
for(var k = 1; k < rowLength; k += 1){
vpn_server_clientlist_value += "<";
if (document.getElementById("openvpnd_clientlist_table").rows[k].cells[1].innerHTML.lastIndexOf("...") < 0)
vpn_server_clientlist_value += document.getElementById("openvpnd_clientlist_table").rows[k].cells[1].innerHTML;
else
vpn_server_clientlist_value += document.getElementById("openvpnd_clientlist_table").rows[k].cells[1].title;
vpn_server_clientlist_value += ">";
vpn_server_clientlist_value += overlib_str3[k];
}
vpn_server_clientlist_array = vpn_server_clientlist_value;
if(vpn_server_clientlist_array == "") {
showopenvpnd_clientlist();
openvpnd_connected_status();
}
}
var overlib_str2 = new Array(); //Viz add 2013.10 for record longer VPN client username/pwd for OpenVPN
var overlib_str3 = new Array(); //Viz add 2013.10 for record longer VPN client username/pwd for OpenVPN
function showopenvpnd_clientlist(){
var vpn_server_clientlist_row = vpn_server_clientlist_array.split('<');
var code = "";
code +='<table width="100%" cellspacing="0" cellpadding="4" align="center" class="list_table" id="openvpnd_clientlist_table">';
code +='<tr id="row0"><td width="15%" id="conn0"></td><td width="35%" title="<% nvram_get("http_username"); %>"><% nvram_get("http_username"); %></td><td width="35%" style="text-align:center;">-</td><td width="15%" style="text-align:center;">-</td></tr>';
if(vpn_server_clientlist_row.length > 1){
for(var i = 1; i < vpn_server_clientlist_row.length; i++){
overlib_str2[i] = "";
overlib_str3[i] = "";
code +='<tr id="row'+i+'">';
var vpn_server_clientlist_col = vpn_server_clientlist_row[i].split('>');
code +='<td width="15%" id="conn'+i+'"></td>';
for(var j = 0; j < vpn_server_clientlist_col.length; j++){
if(j == 0){
if(vpn_server_clientlist_col[0].length >32){
overlib_str2[i] = vpn_server_clientlist_col[0];
vpn_server_clientlist_col[0] = vpn_server_clientlist_col[0].substring(0, 30)+"...";
code +='<td width="35%" title="'+overlib_str2[i]+'">'+ vpn_server_clientlist_col[0] +'</td>';
}else{
code +='<td width="35%" title="'+vpn_server_clientlist_col[0]+'">'+ vpn_server_clientlist_col[0] +'</td>';
}
}
else if(j ==1){
overlib_str3[i] = vpn_server_clientlist_col[1];
if (document.getElementById('show_pass').checked == false) {
code +='<td width="35%">*****</td>';
}else if(vpn_server_clientlist_col[1].length >32){
vpn_server_clientlist_col[1] = vpn_server_clientlist_col[1].substring(0, 30)+"...";
code +='<td width="35%" title="'+overlib_str3[i]+'">'+ vpn_server_clientlist_col[1] +'</td>';
}else{
code +='<td width="35%">'+ vpn_server_clientlist_col[1] +'</td>';
}
}
}
code +='<td width="15%">';
code +='<input class="remove_btn" onclick="del_Row(this, \'openvpnd\');" value=""/></td></tr>';
}
}
code +='</table>';
document.getElementById("openvpnd_clientlist_Block").innerHTML = code;
}
function parseOpenVPNClients(client_status){ //192.168.123.82:46954 10.8.0.6 pine\n
openvpnd_connected_clients = [];
var Loginfo = client_status;
if (Loginfo == "") {return;}
Loginfo = Loginfo.replace('\r\n', '\n');
Loginfo = Loginfo.replace('\n\r', '\n');
Loginfo = Loginfo.replace('\r', '\n');
var lines = Loginfo.split('\n');
for (i = 0; i < lines.length; i++){
var fields = lines[i].split(' ');
if ( fields.length != 3 ) continue;
openvpnd_connected_clients.push({"username":fields[2],"remoteIP":fields[0],"VPNIP":fields[1]});
}
}
function showOpenVPNClients(uname){
var statusmenu = "";
var statustitle = "";
statustitle += "<div style=\"text-decoration:underline;\">VPN IP ( Remote IP )</div>";
_caption = statustitle;
for (i = 0; i < openvpnd_connected_clients.length; i++){
if(uname == openvpnd_connected_clients[i].username){
statusmenu += "<div>"+openvpnd_connected_clients[i].VPNIP+" \t( "+openvpnd_connected_clients[i].remoteIP+" )</div>";
}
}
return overlib(statusmenu, WIDTH, 260, OFFSETX, -360, LEFT, STICKY, CAPTION, _caption, CLOSETITLE, '');
}
function check_vpn_server_state(){
if(vpn_server_enable == '1' && service_state != '2'){
document.getElementById('export_div').style.display = "none";
document.getElementById('openvpn_initial').style.display = "";
update_vpn_server_state();
}
}
function update_vpn_server_state() {
$.ajax({
url: '/ajax_openvpn_server.asp',
dataType: 'script',
error: function(xhr) {
setTimeout("update_vpn_server_state();", 1000);
},
success: function() {
if(vpnd_state != '2' && (vpnd_errno == '1' || vpnd_errno == '2')){
document.getElementById('openvpn_initial').style.display = "none";
document.getElementById('openvpn_error_message').innerHTML = "<span><#2153#></span>";
document.getElementById('openvpn_error_message').style.display = "";
}
else if(vpnd_state != '2' && vpnd_errno == '4'){
document.getElementById('openvpn_initial').style.display = "none";
document.getElementById('openvpn_error_message').innerHTML = "<span><#2154#></span>";
document.getElementById('openvpn_error_message').style.display = "";
}
else if(vpnd_state != '2' && vpnd_errno == '5'){
document.getElementById('openvpn_initial').style.display = "none";
document.getElementById('openvpn_error_message').innerHTML = "<span><#2155#></span>";
document.getElementById('openvpn_error_message').style.display = "";
}
else if(vpnd_state == '-1' && vpnd_errno == '0'){
document.getElementById('openvpn_initial').style.display = "none";
document.getElementById('openvpn_error_message').innerHTML = "<span><#2156#></span>";
document.getElementById('openvpn_error_message').style.display = "";
}
else if(vpnd_state != '2'){
setTimeout("update_vpn_server_state();", 1000);
}
else{ // OpenVPN server ready , vpn_server1_state==2
setTimeout("location.href='Advanced_VPN_OpenVPN.asp';", 1000);
return;
}
}
});
}
function showMailPanel(){
var checker = {
server: document.mailConfigForm.PM_SMTP_SERVER.value,
mailPort: document.mailConfigForm.PM_SMTP_PORT.value,
user: document.mailConfigForm.PM_SMTP_AUTH_USER.value,
pass: document.mailConfigForm.PM_SMTP_AUTH_PASS.value,
end: 0
}
if(checker.server == "" || checker.mailPort == "" || checker.user == "" || checker.pass == ""){
$("#mailConfigPanelContainer").fadeIn(300);
$("#mailSendPanelContainer").fadeOut(300);
}
else{
$("#mailConfigPanelContainer").fadeOut(300);
$("#mailSendPanelContainer").fadeIn(300);
}
}
function switchMode(mode){
if(mode == "1"){ //general setting
document.getElementById("OpenVPN_setting").style.display = "";
if(vpn_server_enable == "1"){
document.getElementById("openvpn_export").style.display = "";
}
else{
document.getElementById("openvpn_export").style.display = "none";
}
document.getElementById("divAdvanced").style.display = "none";
}
else{
document.getElementById("OpenVPN_setting").style.display = "none";
document.getElementById("openvpn_export").style.display = "none";
document.getElementById("divAdvanced").style.display = "";
}
}
function enable_openvpn(state){
var tmp_value = "";
for (var i=1; i < 3; i++) {
if (i == openvpn_unit) {
if (state == 1)
tmp_value += ""+i+",";
} else {
if (document.form.vpn_serverx_start.value.indexOf(''+(i)) >= 0)
tmp_value += ""+i+","
}
}
document.form.vpn_serverx_start.value = tmp_value;
}
/* Advanced Setting start */
function change_vpn_unit(val){
FormActions("apply.cgi", "change_vpn_server_unit", "", "");
document.form.target = "";
document.form.submit();
}
function update_visibility(){
var auth = document.form.vpn_server_crypt.value;
var iface = document.form.vpn_server_if.value;
var hmac = document.form.vpn_server_hmac.value;
userpass = getRadioValue(document.form.vpn_server_userpass_auth);
var dhcp = getRadioValue(document.form.vpn_server_dhcp);
var dns = getRadioValue(document.form.vpn_server_x_dns);
if(auth != "tls")
ccd = 0;
else
ccd = getRadioValue(document.form.vpn_server_ccd);
showhide("server_authhmac", (auth != "secret"));
showhide("server_snnm", ((auth == "tls") && (iface == "tun")));
showhide("server_plan", ((auth == "tls") && (iface == "tun")));
showhide("server_local", ((auth == "secret") && (iface == "tun")));
showhide("server_reneg", (auth != "secret")); //add by Viz 2014.06
showhide("server_ccd", (auth == "tls"));
showhide("server_c2c", ccd);
showhide("server_ccd_excl", ccd);
showhide("openvpn_client_table", ccd);
showhide("openvpn_clientlist_Block", ccd);
showhide("server_pdns", ((auth == "tls") && (dns == 1)));
showhide("server_dhcp",((auth == "tls") && (iface == "tap")));
showhide("server_range", ((dhcp == 0) && (auth == "tls") && (iface == "tap")));
showhide("server_tls_crypto_text", ((auth == "tls") || (auth == "secret"))); //add by Viz
showhide("server_custom_crypto_text", (auth == "custom"));
showhide("server_igncrt", (userpass == 1));
}
function set_Keys() {
cal_panel_block("tlsKey_panel", 0.15);
$("#tlsKey_panel").fadeIn(300);
}
function updateCRTValue(){
$.ajax({
url: '/ajax_openvpn_server.asp',
dataType: 'script',
timeout: 1500,
error: function(xhr){
setTimeout("updateCRTValue();",1000);
},
success: function(){
if (openvpn_unit == 1) {
document.openvpnTLSKeyForm.edit_vpn_crt_server_ca.value = vpn_crt_server1_ca[0].replace(/
/g, "\n").replace(/
/g, "\r");
document.openvpnTLSKeyForm.edit_vpn_crt_server_crt.value = vpn_crt_server1_crt[0].replace(/
/g, "\n").replace(/
/g, "\r");
document.openvpnTLSKeyForm.edit_vpn_crt_server_key.value = vpn_crt_server1_key[0].replace(/
/g, "\n").replace(/
/g, "\r");
document.openvpnTLSKeyForm.edit_vpn_crt_server_dh.value = vpn_crt_server1_dh[0].replace(/
/g, "\n").replace(/
/g, "\r");
document.openvpnTLSKeyForm.edit_vpn_crt_server_crl.value = vpn_crt_server1_crl[0].replace(/
/g, "\n").replace(/
/g, "\r");
document.openvpnTLSKeyForm.edit_vpn_crt_server_static.value = vpn_crt_server1_static[0].replace(/
/g, "\n").replace(/
/g, "\r");
document.openvpnTLSKeyForm.edit_vpn_crt_server_extra.value = vpn_crt_server1_extra[0].replace(/
/g, "\n").replace(/
/g, "\r");
} else if (openvpn_unit == 2) {
document.openvpnTLSKeyForm.edit_vpn_crt_server_ca.value = vpn_crt_server2_ca[0].replace(/
/g, "\n").replace(/
/g, "\r");
document.openvpnTLSKeyForm.edit_vpn_crt_server_crt.value = vpn_crt_server2_crt[0].replace(/
/g, "\n").replace(/
/g, "\r");
document.openvpnTLSKeyForm.edit_vpn_crt_server_key.value = vpn_crt_server2_key[0].replace(/
/g, "\n").replace(/
/g, "\r");
document.openvpnTLSKeyForm.edit_vpn_crt_server_dh.value = vpn_crt_server2_dh[0].replace(/
/g, "\n").replace(/
/g, "\r");
document.openvpnTLSKeyForm.edit_vpn_crt_server_crl.value = vpn_crt_server2_crl[0].replace(/
/g, "\n").replace(/
/g, "\r");
document.openvpnTLSKeyForm.edit_vpn_crt_server_static.value = vpn_crt_server2_static[0].replace(/
/g, "\n").replace(/
/g, "\r");
document.openvpnTLSKeyForm.edit_vpn_crt_server_extra.value = vpn_crt_server2_extra[0].replace(/
/g, "\n").replace(/
/g, "\r");
}
}
})
}
function addRow_Group_Advanced(upper){
var client_num = document.getElementById("openvpn_clientlist_table").rows.length;
var item_num = document.getElementById("openvpn_clientlist_table").rows[0].cells.length;
if(client_num >= upper){
alert("<#1369#> " + upper + " <#1370#>");
return false;
}
if(document.form.vpn_clientlist_commonname_0.value==""){
alert("<#140#>");
document.form.vpn_clientlist_commonname_0.focus();
document.form.vpn_clientlist_commonname_0.select();
return false;
}
if(document.form.vpn_clientlist_subnet_0.value==""){
alert("<#140#>");
document.form.vpn_clientlist_subnet_0.focus();
document.form.vpn_clientlist_subnet_0.select();
return false;
}
if(document.form.vpn_clientlist_netmask_0.value==""){
alert("<#140#>");
document.form.vpn_clientlist_netmask_0.focus();
document.form.vpn_clientlist_netmask_0.select();
return false;
}
if(item_num >=2){
for(i=0; i<client_num; i++){
if(document.form.vpn_clientlist_commonname_0.value.toLowerCase() == document.getElementById("openvpn_clientlist_table").rows[i].cells[0].innerHTML.toLowerCase()
&& document.form.vpn_clientlist_subnet_0.value == document.getElementById("openvpn_clientlist_table").rows[i].cells[1].innerHTML
&& document.form.vpn_clientlist_netmask_0.value == document.getElementById("openvpn_clientlist_table").rows[i].cells[2].innerHTML){
alert('<#1363#>');
document.form.vpn_clientlist_commonname_0.focus();
document.form.vpn_clientlist_commonname_0.select();
return false;
}
}
}
do_addRow_Group();
}
function do_addRow_Group(){
addRowAdvanced(document.form.vpn_clientlist_commonname_0 ,1);
addRowAdvanced(document.form.vpn_clientlist_subnet_0, 0);
addRowAdvanced(document.form.vpn_clientlist_netmask_0, 0);
addRowAdvanced(document.form.vpn_clientlist_push_0, 0);
document.form.vpn_clientlist_push_0.value="0"; //reset selection
allowed_openvpn_clientlist();
}
function addRowAdvanced(obj, head){
if(head == 1)
openvpn_clientlist_array += "<1>";
else
openvpn_clientlist_array += ">";
openvpn_clientlist_array += obj.value;
obj.value = "";
}
function allowed_openvpn_clientlist(){
var openvpn_clientlist_row = openvpn_clientlist_array.split('<');
var code = "";
code +='<table width="100%" cellspacing="0" cellpadding="4" align="center" class="list_table" id="openvpn_clientlist_table">';
if(openvpn_clientlist_row.length == 1)
code +='<tr><td style="color:#FFCC00;" colspan="6"><#1324#></td>';
else{
for(var i = 1; i < openvpn_clientlist_row.length; i++){
code +='<tr id="row'+i+'">';
var openvpn_clientlist_col = openvpn_clientlist_row[i].split('>');
var wid=[0, 36, 20, 20, 12];
for (var j = 1; j < openvpn_clientlist_col.length; j++){
if (j == 4)
code +='<td width="'+wid[j]+'%">'+ ((openvpn_clientlist_col[j] == 1 || openvpn_clientlist_col[j] == 'Yes') ? 'Yes' : 'No') +'</td>';
else
code +='<td width="'+wid[j]+'%">'+ openvpn_clientlist_col[j] +'</td>';
}
code +='<td width="12%">';
code +='<input class="remove_btn" onclick="del_openvpnRow(this);" value=""/></td>';
}
}
code +='</table>';
document.getElementById("openvpn_clientlist_Block").innerHTML = code;
}
function del_openvpnRow(r) {
var i = r.parentNode.parentNode.rowIndex;
document.getElementById("openvpn_clientlist_table").deleteRow(i);
var openvpn_clientlist_value = "";
var rowLength = document.getElementById("openvpn_clientlist_table").rows.length;
for(var k = 0; k < rowLength; k += 1) {
for(var j = 0; j < document.getElementById("openvpn_clientlist_table").rows[k].cells.length - 1; j += 1){
if(j == 0)
openvpn_clientlist_value += "<1>";
else
openvpn_clientlist_value += ">";
openvpn_clientlist_value += document.getElementById("openvpn_clientlist_table").rows[k].cells[j].innerHTML;
}
}
openvpn_clientlist_array = openvpn_clientlist_value;
if(openvpn_clientlist_array == "")
allowed_openvpn_clientlist();
}
function cancel_Key_panel() {
this.FromObject ="0";
$("#tlsKey_panel").fadeOut(300);
}
function save_keys() {
if (openvpn_unit == "1") {
document.openvpnTLSKeyForm.vpn_crt_server1_ca.value = document.openvpnTLSKeyForm.edit_vpn_crt_server_ca.value;
document.openvpnTLSKeyForm.vpn_crt_server1_crt.value = document.openvpnTLSKeyForm.edit_vpn_crt_server_crt.value;
document.openvpnTLSKeyForm.vpn_crt_server1_key.value = document.openvpnTLSKeyForm.edit_vpn_crt_server_key.value;
document.openvpnTLSKeyForm.vpn_crt_server1_dh.value = document.openvpnTLSKeyForm.edit_vpn_crt_server_dh.value;
document.openvpnTLSKeyForm.vpn_crt_server1_crl.value = document.openvpnTLSKeyForm.edit_vpn_crt_server_crl.value;
document.openvpnTLSKeyForm.vpn_crt_server1_static.value = document.openvpnTLSKeyForm.edit_vpn_crt_server_static.value;
document.openvpnTLSKeyForm.vpn_crt_server1_extra.value = document.openvpnTLSKeyForm.edit_vpn_crt_server_extra.value;
document.openvpnTLSKeyForm.vpn_crt_server1_static.disabled = false;
document.openvpnTLSKeyForm.vpn_crt_server1_ca.disabled = false;
document.openvpnTLSKeyForm.vpn_crt_server1_crt.disabled = false;
document.openvpnTLSKeyForm.vpn_crt_server1_key.disabled = false;
document.openvpnTLSKeyForm.vpn_crt_server1_dh.disabled = false;
document.openvpnTLSKeyForm.vpn_crt_server1_crl.disabled = false;
document.openvpnTLSKeyForm.vpn_crt_server1_extra.disabled = false;
} else {
document.openvpnTLSKeyForm.vpn_crt_server2_ca.value = document.openvpnTLSKeyForm.edit_vpn_crt_server_ca.value;
document.openvpnTLSKeyForm.vpn_crt_server2_crt.value = document.openvpnTLSKeyForm.edit_vpn_crt_server_crt.value;
document.openvpnTLSKeyForm.vpn_crt_server2_key.value = document.openvpnTLSKeyForm.edit_vpn_crt_server_key.value;
document.openvpnTLSKeyForm.vpn_crt_server2_dh.value = document.openvpnTLSKeyForm.edit_vpn_crt_server_dh.value;
document.openvpnTLSKeyForm.vpn_crt_server2_crl.value = document.openvpnTLSKeyForm.edit_vpn_crt_server_crl.value;
document.openvpnTLSKeyForm.vpn_crt_server2_static.value = document.openvpnTLSKeyForm.edit_vpn_crt_server_static.value;
document.openvpnTLSKeyForm.vpn_crt_server2_extra.value = document.openvpnTLSKeyForm.edit_vpn_crt_server_extra.value;
document.openvpnTLSKeyForm.vpn_crt_server2_static.disabled = false;
document.openvpnTLSKeyForm.vpn_crt_server2_ca.disabled = false;
document.openvpnTLSKeyForm.vpn_crt_server2_crt.disabled = false;
document.openvpnTLSKeyForm.vpn_crt_server2_key.disabled = false;
document.openvpnTLSKeyForm.vpn_crt_server2_dh.disabled = false;
document.openvpnTLSKeyForm.vpn_crt_server2_crl.disabled = false;
document.openvpnTLSKeyForm.vpn_crt_server2_extra.disabled = false;
}
document.openvpnTLSKeyForm.submit();
cancel_Key_panel();
}
/* Advanced Setting end */
function update_vpn_client_state() {
$.ajax({
url: '/ajax_openvpn_client_status.xml',
dataType: 'xml',
error: function(xml) {
setTimeout("update_vpn_client_state();", 1000);
},
success: function(xml) {
var vpnserverXML = xml.getElementsByTagName("vpnserver");
var client_status = vpnserverXML[0].firstChild.nodeValue;
parseOpenVPNClients(client_status);
openvpnd_connected_status();
setTimeout("update_vpn_client_state();", 3000);
}
});
}
function defaultSettings() {
if (confirm("WARNING: This will reset this OpenVPN server to factory default settings!\n\nKeys and certificates associated to this instance will also be DELETED!Proceed?")) {
document.form.action_script.value = "stop_vpnserver" + openvpn_unit + ";clearvpnserver" + openvpn_unit;
enable_openvpn(0);
document.form.VPNServer_enable.value = "0";
parent.showLoading();
document.form.submit();
} else {
return false;
}
}
</script>
</head>
<body onload="initial();">
<div id="tlsKey_panel" class="contentM_qis">
<table class="QISform_wireless" border=0 align="center" cellpadding="5" cellspacing="0">
<form method="post" name="openvpnTLSKeyForm" action="/start_apply.htm" target="hidden_frame">
<input type="hidden" name="current_page" value="Advanced_VPN_OpenVPN.asp">
<input type="hidden" name="next_page" value="Advanced_VPN_OpenVPN.asp">
<input type="hidden" name="modified" value="0">
<input type="hidden" name="flag" value="background">
<input type="hidden" name="action_mode" value="apply">
<input type="hidden" name="action_script" value="saveNvram">
<input type="hidden" name="action_wait" value="1">
<input type="hidden" name="preferred_lang" id="preferred_lang" value="<% nvram_get("preferred_lang"); %>">
<input type="hidden" name="firmver" value="<% nvram_get("firmver"); %>">
<input type="hidden" name="vpn_crt_server1_ca" value="" disabled>
<input type="hidden" name="vpn_crt_server1_crt" value="" disabled>
<input type="hidden" name="vpn_crt_server1_key" value="" disabled>
<input type="hidden" name="vpn_crt_server1_dh" value="" disabled>
<input type="hidden" name="vpn_crt_server1_crl" value="" disabled>
<input type="hidden" name="vpn_crt_server1_extra" value="" disabled>
<input type="hidden" name="vpn_crt_server2_ca" value="" disabled>
<input type="hidden" name="vpn_crt_server2_crt" value="" disabled>
<input type="hidden" name="vpn_crt_server2_key" value="" disabled>
<input type="hidden" name="vpn_crt_server2_dh" value="" disabled>
<input type="hidden" name="vpn_crt_server2_crl" value="" disabled>
<input type="hidden" name="vpn_crt_server2_extra" value="" disabled>
<input type="hidden" name="vpn_crt_server1_static" value="" disabled>
<input type="hidden" name="vpn_crt_server2_static" value="" disabled>
<tr>
<div class="description_down"><#2170#></div>
</tr>
<tr>
<div style="margin-left:30px; margin-top:10px;">
<p><#2164#> <span style="color:#FFCC00;">----- BEGIN xxx ----- </span>/<span style="color:#FFCC00;"> ----- END xxx -----</span> <#2165#>
<p>Limit: 3999 characters per field
</div>
<div style="margin:5px;*margin-left:-5px;"><img style="width: 730px; height: 2px;" src="/images/New_ui/export/line_export.png"></div>
</tr>
<tr>
<td valign="top">
<table width="700px" border="0" cellpadding="4" cellspacing="0">
<tbody>
<tr>
<td valign="top">
<table width="100%" id="page1_tls" border="1" align="center" cellpadding="4" cellspacing="0" class="FormTable">
<tr>
<th><#2169#></th>
<td>
<textarea rows="8" class="textarea_ssh_table" id="edit_vpn_crt_server_static" name="edit_vpn_crt_server_static" cols="65" maxlength="3999"></textarea>
</td>
</tr>
<tr id="edit_tls1">
<th><#2162#></th>
<td>
<textarea rows="8" class="textarea_ssh_table" id="edit_vpn_crt_server_ca" name="edit_vpn_crt_server_ca" cols="65" maxlength="3999"></textarea>
</td>
</tr>
<tr id="edit_tls2">
<th><#2167#></th>
<td>
<textarea rows="8" class="textarea_ssh_table" id="edit_vpn_crt_server_crt" name="edit_vpn_crt_server_crt" cols="65" maxlength="3999"></textarea>
</td>
</tr>
<tr id="edit_tls3">
<th><#2168#></th>
<td>
<textarea rows="8" class="textarea_ssh_table" id="edit_vpn_crt_server_key" name="edit_vpn_crt_server_key" cols="65" maxlength="3999"></textarea>
</td>
</tr>
<tr id="edit_tls4">
<th><#2163#></th>
<td>
<textarea rows="8" class="textarea_ssh_table" id="edit_vpn_crt_server_dh" name="edit_vpn_crt_server_dh" cols="65" maxlength="3999"></textarea>
</td>
</tr>
<tr id="edit_tls5">
<th>Certificate Revocation List (Optional)</th>
<td>
<textarea rows="8" class="textarea_ssh_table" id="edit_vpn_crt_server_crl" name="edit_vpn_crt_server_crl" cols="65" maxlength="3999"></textarea>
</td>
</tr>
<tr id="edit_tls6">
<th>Extra Chain Certificates (Optional)</th>
<td><textarea rows="8" class="textarea_ssh_table" id="edit_vpn_crt_server_extra" name="edit_vpn_crt_server_extra" cols="65" maxlength="3999"></textarea>
</td>
</tr>
</table>