File: ch_system.html

package info (click to toggle)
erlang-doc-html 1%3A10.b.1a-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 22,488 kB
  • ctags: 9,933
  • sloc: erlang: 505; ansic: 323; perl: 61; sh: 45; makefile: 39
file content (214 lines) | stat: -rw-r--r-- 6,145 bytes parent folder | download
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- This document was generated using DocBuilder 3.3.2 -->
<HTML>
<HEAD>
  <TITLE>Using the File Transfer Service</TITLE>
  <SCRIPT type="text/javascript" src="../../../../doc/erlresolvelinks.js">
</SCRIPT>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#FF00FF"
      ALINK="#FF0000">
<CENTER>
<A HREF="http://www.erlang.se"><IMG BORDER=0 ALT="[Ericsson AB]" SRC="min_head.gif"></A>
</CENTER>
<A NAME="4"><!-- Empty --></A>
<H2>4 Using the File Transfer Service</H2>
<A NAME="4.1"><!-- Empty --></A>
<H3>4.1 Overview</H3>

<P>This chapter describes how two File Transfer Service applications interact.
<A NAME="4.1.1"><!-- Empty --></A>
<H4>4.1.1 Components</H4>

<P>There are several ways the OMG File Transfer Service can be used. 
Below one scenario is visualized: 

<P>
<CENTER>
<IMG ALT="CosFileTransfer" SRC="CosFileTransfer.gif"><BR>
<EM><A NAME="CosFileTransfer"><!-- Empty --></A>Figure 1: The File Transfer Service Components.</EM>

</CENTER>

<P>
<UL>

<LI>
<STRONG>Source ORB:</STRONG> this is the ORB we want to transfer a file from/via and it holds 
an object reference to a 
<A HREF="CosFileTransfer_VirtualFileSystem.html">Virtual File System (VFS)</A> which, 
in this example, represents an FTP server.
</LI>


<LI>
<STRONG>Target ORB:</STRONG> the goal may be, for example, to transfer a new file or append to an 
existing file placed at the location that this ORB's <CODE>VFS</CODE> represents.
In this scenario it is the local disk or the NFS.
</LI>


<LI>
<STRONG>Transport Protocol:</STRONG> initially the ORB's, i.e., target and source, communicate via
normal <CODE>CORBA</CODE> requests to determine whether or not they can communicate. If the 
File Transfer Service's have one, or more, <CODE>Transport Protocol</CODE> in common the data
will be streamed using this protocol. The cosFileTransfer application currently supports 
<CODE>TCP/IP</CODE> and <CODE>SSL</CODE>.
</LI>


</UL>

<P>Which type of file system the <CODE>VFS</CODE> is supposed to represent is determined
by the options given when creating it, which is also how one determine which 
<CODE>Transport Protocol</CODE> to use. Hence, the source and target <CODE>VFS</CODE> described above
can be started by invoking, respectively, the following operations:
<PRE>
1&#62; SVFS = cosFileTransferApp:create_VFS('FTP', [], Host, 21, [{protocol, tcp}]),
2&#62; TVFS = cosFileTransferApp:create_VFS({'NATIVE', 'cosFileTransferNATIVE_file'}, 
                                        [], OtherHost, 0, [{protocol, tcp}]),
      
</PRE>

<P>Naturally can any combination of <CODE>VFS</CODE>-types be used and it is also possible
to use own drivers, i.e., <CODE>{'NATIVE', 'MyDriver'}</CODE>.
<P>After creating necessary <CODE>VFS's</CODE> we can login in and perform operations
on files and directories residing on each file system.<A NAME="4.1.2"><!-- Empty --></A>
<H4>4.1.2 How To Use SSL</H4>

<P>To be able to use <CODE>SSL</CODE> as transport protocol a few configuration
parameters must be set. The required parameters depend on if Orber is
the target or/and the source ORB. However, the SSL_CERT_FILE variable
must be defined in both cases.
<P>Setting of a CA certificate file with an option does not work due to 
weaknesses in the SSLeay package. A work-around in the ssl application is 
to set the OS environment variable SSL_CERT_FILE before SSL is started. 
         However, then the CA certificate file will be global for all connections 
(both incomming and outgoing calls).<A NAME="4.1.2.1"><!-- Empty --></A>
<H5>4.1.2.1 Configurations when cosFileTransfer is Used as Target</H5>

<P>The following three configuration variables can be used to configure
cosFileTransfer's SSL target behavior.

<P>
<UL>

<LI>
<STRONG>ssl_server_certfile</STRONG> which is a path to a file containing a
chain of PEM encoded certificates for cosFileTransfer as target.
         
</LI>


<LI>
<STRONG>ssl_server_verify</STRONG> which specifies type of verification: 
0 = do not verify peer; 1 = verify peer, verify client once, 2 = 
verify peer, verify client once, fail if no peer certificate. 
The default value is 0.
         
</LI>


<LI>
<STRONG>ssl_server_depth</STRONG> which specifies verification depth, i.e.
how far in a chain of certificates the verification process shall 
proceed before the verification is considered successful. The
default value is 1. 
         
</LI>


</UL>

<P>There also exist a number of API functions for accessing the values of 
these variables:
<P>
<UL>

<LI>
         cosFileTransferApp:ssl_server_certfile/0
         
</LI>


<LI>
         cosFileTransferApp:ssl_server_verify/0
         
</LI>


<LI>
         cosFileTransferApp:ssl_server_depth/0
         
</LI>


</UL>
<A NAME="4.1.2.2"><!-- Empty --></A>
<H5>4.1.2.2 Configurations when cosFileTransfer is used as Source</H5>

<P>Below is the list of configuration variables used when cosFileTransfer
act as the source application.
<P>
<UL>

<LI>
<STRONG>ssl_client_certfile</STRONG> which is a path to a file containing a
chain of PEM encoded certificates used in outgoing calls.
         
</LI>


<LI>
<STRONG>ssl_client_verify</STRONG> which specifies type of verification: 
0 = do not verify peer; 1 = verify peer, verify client once, 2 = 
verify peer, verify client once, fail if no peer certificate. 
The default value is 0.
         
</LI>


<LI>
<STRONG>ssl_client_depth</STRONG> which specifies verification depth, i.e. 
how far in a chain of certificates the verification process shall
proceed before the verification is considered successful. The
default value is 1. 
         
</LI>


</UL>

<P>There also exist a number of API functions for accessing the values of
these variables in the client processes:
<P>
<UL>

<LI>
         cosFileTransferApp:ssl_client_certfile/0
         
</LI>


<LI>
         cosFileTransferApp:ssl_client_verify/0
         
</LI>


<LI>
         cosFileTransferApp:ssl_client_depth/0
         
</LI>


</UL>
<CENTER>
<HR>
<SMALL>
Copyright &copy; 1991-2004
<A HREF="http://www.erlang.se">Ericsson AB</A><BR>
</SMALL>
</CENTER>
</BODY>
</HTML>