1
<?xml version="1.0" encoding="latin1" ?>
2
<!DOCTYPE chapter SYSTEM "chapter.dtd">
9
<holder>Ericsson AB, All Rights Reserved</holder>
12
The contents of this file are subject to the Erlang Public License,
13
Version 1.1, (the "License"); you may not use this file except in
14
compliance with the License. You should have received a copy of the
15
Erlang Public License along with this software. If not, it can be
16
retrieved online at http://www.erlang.org/.
18
Software distributed under the License is distributed on an "AS IS"
19
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
20
the License for the specific language governing rights and limitations
23
The Initial Developer of the Original Code is Ericsson AB.
26
<title>Using the File Transfer Service</title>
29
<date>2001-08-07</date>
34
<title>Overview</title>
35
<p>This chapter describes how two File Transfer Service applications interact.</p>
38
<title>Components</title>
39
<p>There are several ways the OMG File Transfer Service can be used.
40
Below one scenario is visualized: </p>
41
<marker id="CosFileTransfer"></marker>
42
<image file="CosFileTransfer">
43
<icaption>Figure 1: The File Transfer Service Components.</icaption>
45
<list type="bulleted">
46
<item><em>Source ORB:</em> this is the ORB we want to transfer a file from/via and it holds
47
an object reference to a
48
<seealso marker="CosFileTransfer_VirtualFileSystem">Virtual File System (VFS)</seealso> which,
49
in this example, represents an FTP server.</item>
50
<item><em>Target ORB:</em> the goal may be, for example, to transfer a new file or append to an
51
existing file placed at the location that this ORB's <c>VFS</c> represents.
52
In this scenario it is the local disk or the NFS.</item>
53
<item><em>Transport Protocol:</em> initially the ORB's, i.e., target and source, communicate via
54
normal <c>CORBA</c> requests to determine whether or not they can communicate. If the
55
File Transfer Service's have one, or more, <c>Transport Protocol</c> in common the data
56
will be streamed using this protocol. The cosFileTransfer application currently supports
57
<c>TCP/IP</c> and <c>SSL</c>.</item>
59
<p>Which type of file system the <c>VFS</c> is supposed to represent is determined
60
by the options given when creating it, which is also how one determine which
61
<c>Transport Protocol</c> to use. Hence, the source and target <c>VFS</c> described above
62
can be started by invoking, respectively, the following operations:</p>
64
1> SVFS = cosFileTransferApp:create_VFS('FTP', [], Host, 21, [{protocol, tcp}]),
65
2> TVFS = cosFileTransferApp:create_VFS({'NATIVE', 'cosFileTransferNATIVE_file'},
66
[], OtherHost, 0, [{protocol, tcp}]),
68
<p>Naturally can any combination of <c>VFS</c>-types be used and it is also possible
69
to use own drivers, i.e., <c>{'NATIVE', 'MyDriver'}</c>.</p>
70
<p>After creating necessary <c>VFS's</c> we can login in and perform operations
71
on files and directories residing on each file system.</p>
75
<title>How To Use SSL</title>
76
<p>To be able to use <c>SSL</c> as transport protocol a few configuration
77
parameters must be set. The required parameters depend on if Orber is
78
the target or/and the source ORB. However, the SSL_CERT_FILE variable
79
must be defined in both cases.</p>
80
<p>Setting of a CA certificate file with an option does not work due to
81
weaknesses in the SSLeay package. A work-around in the ssl application is
82
to set the OS environment variable SSL_CERT_FILE before SSL is started.
83
However, then the CA certificate file will be global for all connections
84
(both incoming and outgoing calls).</p>
87
<title>Configurations when cosFileTransfer is Used as Target</title>
88
<p>The following three configuration variables can be used to configure
89
cosFileTransfer's SSL target behavior.</p>
90
<list type="bulleted">
91
<item><em>ssl_server_certfile</em> which is a path to a file containing a
92
chain of PEM encoded certificates for cosFileTransfer as target.</item>
93
<item><em>ssl_server_verify</em> which specifies type of verification:
94
0 = do not verify peer; 1 = verify peer, verify client once, 2 =
95
verify peer, verify client once, fail if no peer certificate.
96
The default value is 0.</item>
97
<item><em>ssl_server_depth</em> which specifies verification depth, i.e.
98
how far in a chain of certificates the verification process shall
99
proceed before the verification is considered successful. The
100
default value is 1. </item>
102
<p>There also exist a number of API functions for accessing the values of
104
<list type="bulleted">
105
<item>cosFileTransferApp:ssl_server_certfile/0</item>
106
<item>cosFileTransferApp:ssl_server_verify/0</item>
107
<item>cosFileTransferApp:ssl_server_depth/0</item>
112
<title>Configurations when cosFileTransfer is used as Source</title>
113
<p>Below is the list of configuration variables used when cosFileTransfer
114
act as the source application.</p>
115
<list type="bulleted">
116
<item><em>ssl_client_certfile</em> which is a path to a file containing a
117
chain of PEM encoded certificates used in outgoing calls.</item>
118
<item><em>ssl_client_verify</em> which specifies type of verification:
119
0 = do not verify peer; 1 = verify peer, verify client once, 2 =
120
verify peer, verify client once, fail if no peer certificate.
121
The default value is 0.</item>
122
<item><em>ssl_client_depth</em> which specifies verification depth, i.e.
123
how far in a chain of certificates the verification process shall
124
proceed before the verification is considered successful. The
125
default value is 1. </item>
127
<p>There also exist a number of API functions for accessing the values of
128
these variables in the client processes:</p>
129
<list type="bulleted">
130
<item>cosFileTransferApp:ssl_client_certfile/0</item>
131
<item>cosFileTransferApp:ssl_client_verify/0</item>
132
<item>cosFileTransferApp:ssl_client_depth/0</item>