|
53 | 53 | our $parallelism_out; |
54 | 54 | our $sort_size; |
55 | 55 | our $use_pk_if_possible; |
| 56 | +our $sforce_ssl; |
56 | 57 | our $pforce_ssl; |
57 | 58 | our $stringtype_unspecified; |
58 | 59 | our $skip_citext_length_check; |
@@ -114,6 +115,7 @@ sub parse_conf_file |
114 | 115 | 'sort size' => 'sort_size', |
115 | 116 | 'use pk if possible' => 'use_pk_if_possible', |
116 | 117 | 'ignore errors' => 'ignore_errors', |
| 118 | + 'sql server force ssl' => 'sforce_ssl', |
117 | 119 | 'postgresql force ssl' => 'pforce_ssl', |
118 | 120 | 'stringtype unspecified' => 'stringtype_unspecified', |
119 | 121 | 'skip citext length check' => 'skip_citext_length_check', |
@@ -168,6 +170,7 @@ sub set_default_conf_values |
168 | 170 | $ignore_errors=0 unless (defined ($ignore_errors)); |
169 | 171 | $pp=5432 unless (defined ($pp)); # Default port for PostgreSQL |
170 | 172 | $sp=1433 unless (defined ($sp)); # Default port for SQL-Server |
| 173 | + $sforce_ssl=0 unless (defined ($sforce_ssl)); |
171 | 174 | $pforce_ssl=0 unless (defined ($pforce_ssl)); |
172 | 175 | $stringtype_unspecified=0 unless (defined ($stringtype_unspecified)); |
173 | 176 | $skip_citext_length_check=0 unless (defined ($skip_citext_length_check)); |
@@ -894,6 +897,8 @@ sub usage |
894 | 897 | parallelism level for the kettle job (input, SQL Server). Default 1. |
895 | 898 | -po PARALLELISM_OUT |
896 | 899 | parallelism level for the kettle job (output, PostgreSQL). Default 8. |
| 900 | + -sforce_ssl |
| 901 | + force a SSL session to SQL Server |
897 | 902 | -pforce_ssl |
898 | 903 | force a SSL session to PostgreSQL |
899 | 904 | -stringtype_unspecified |
@@ -1029,6 +1034,14 @@ sub generate_kettle |
1029 | 1034 | $newtemplate =~ s/<use_batch>Y<\/use_batch>/<use_batch>N<\/use_batch>/g; # Cannot use batch mode with ignore errors |
1030 | 1035 | } |
1031 | 1036 |
|
| 1037 | + if ($sforce_ssl) |
| 1038 | + { |
| 1039 | + $newtemplate =~ s/__sforce_ssl__/<attribute><code>EXTRA_OPTION_MSSQL.ssl<\/code><attribute>require<\/attribute><\/attribute>/g; |
| 1040 | + } |
| 1041 | + else |
| 1042 | + { |
| 1043 | + $newtemplate =~ s/__sforce_ssl__//g; |
| 1044 | + } |
1032 | 1045 | if ($pforce_ssl) |
1033 | 1046 | { |
1034 | 1047 | $newtemplate =~ s/__pforce_ssl__/<attribute><code>EXTRA_OPTION_POSTGRESQL.ssl<\/code><attribute>true<\/attribute><\/attribute>\n<attribute><code>EXTRA_OPTION_POSTGRESQL.sslfactory<\/code><attribute>org.postgresql.ssl.NonValidatingFactory<\/attribute><\/attribute>/g; |
@@ -1066,6 +1079,14 @@ sub generate_kettle |
1066 | 1079 | $newincrementaltemplate =~ s/__PARALLELISM_OUT__/$parallelism_out/g; |
1067 | 1080 | $newincrementaltemplate =~ s/__sort_size__/$sort_size/g; |
1068 | 1081 |
|
| 1082 | + if ($sforce_ssl) |
| 1083 | + { |
| 1084 | + $newincrementaltemplate =~ s/__sforce_ssl__/<attribute><code>EXTRA_OPTION_MSSQL.ssl<\/code><attribute>require<\/attribute><\/attribute>/g; |
| 1085 | + } |
| 1086 | + else |
| 1087 | + { |
| 1088 | + $newincrementaltemplate =~ s/__sforce_ssl__//g; |
| 1089 | + } |
1069 | 1090 | if ($pforce_ssl) |
1070 | 1091 | { |
1071 | 1092 | $newincrementaltemplate =~ s/__pforce_ssl__/<attribute><code>EXTRA_OPTION_POSTGRESQL.ssl<\/code><attribute>true<\/attribute><\/attribute>\n<attribute><code>EXTRA_OPTION_POSTGRESQL.sslfactory<\/code><attribute>org.postgresql.ssl.NonValidatingFactory<\/attribute><\/attribute>/g; |
@@ -3283,6 +3304,7 @@ sub resolve_name_conflicts |
3283 | 3304 | "sort_size=i" => \$sort_size, |
3284 | 3305 | "use_pk_if_possible=s" => \$use_pk_if_possible, |
3285 | 3306 | "ignore_errors" => \$ignore_errors, |
| 3307 | + "sforce_ssl" => \$sforce_ssl, |
3286 | 3308 | "pforce_ssl" => \$pforce_ssl, |
3287 | 3309 | "stringtype_unspecified" => \$stringtype_unspecified, |
3288 | 3310 | "skip_citext_length_check" => \$skip_citext_length_check, |
@@ -3420,6 +3442,7 @@ BEGIN |
3420 | 3442 | <data_tablespace/> |
3421 | 3443 | <index_tablespace/> |
3422 | 3444 | <attributes> |
| 3445 | + __sforce_ssl__ |
3423 | 3446 | <attribute><code>EXTRA_OPTION_MSSQL.instance</code><attribute>__sqlserver_instance__</attribute></attribute> |
3424 | 3447 | <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> |
3425 | 3448 | <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> |
@@ -3782,6 +3805,7 @@ BEGIN |
3782 | 3805 | <data_tablespace/> |
3783 | 3806 | <index_tablespace/> |
3784 | 3807 | <attributes> |
| 3808 | + __sforce_ssl__ |
3785 | 3809 | <attribute><code>EXTRA_OPTION_MSSQL.instance</code><attribute>__sqlserver_instance__</attribute></attribute> |
3786 | 3810 | <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> |
3787 | 3811 | <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> |
@@ -4351,6 +4375,7 @@ BEGIN |
4351 | 4375 | <data_tablespace/> |
4352 | 4376 | <index_tablespace/> |
4353 | 4377 | <attributes> |
| 4378 | + __sforce_ssl__ |
4354 | 4379 | <attribute><code>EXTRA_OPTION_MSSQL.instance</code><attribute>__sqlserver_instance__</attribute></attribute> |
4355 | 4380 | <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> |
4356 | 4381 | <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> |
@@ -4781,6 +4806,7 @@ BEGIN |
4781 | 4806 | <data_tablespace/> |
4782 | 4807 | <index_tablespace/> |
4783 | 4808 | <attributes> |
| 4809 | + __sforce_ssl__ |
4784 | 4810 | <attribute><code>EXTRA_OPTION_MSSQL.instance</code><attribute>__sqlserver_instance__</attribute></attribute> |
4785 | 4811 | <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute> |
4786 | 4812 | <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute> |
|
0 commit comments