Source code: com/iborg/robo/HServerSocketFactory.java
1 /*
2 * Copyright (C) 2002 iBorg Corporation. All Rights Reserved.
3 * Copyright (C) 2002 Boris Galinsky. All Rights Reserved.
4 *
5 * This file is part of the share system.
6 *
7 * The share system is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation.
10 *
11 * See terms of license at gnu.org.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 */
19
20 /*
21 * HServerSocketFactory.java
22 *
23 * Created on November 11, 2002, 12:42 PM
24 */
25 package com.iborg.robo;
26
27 import com.iborg.hsocket.*;
28
29 /**
30 *
31 * @author <a href="mailto:sanych@comcast.net">Boris Galinsky</a>.
32 * @version
33 */
34
35 public class HServerSocketFactory {
36 public static IServerSocket createServerSocket() {
37 String connectionURL = "http://localhost/share/";
38 String acceptToken = "bg";
39 String param = System.getProperty(RoboProtocol.paramAcceptToken);
40 if(param != null) {
41 acceptToken = param;
42 }
43
44 param = System.getProperty(RoboProtocol.paramConnectionURL);
45 if(param != null) {
46 connectionURL = param;
47 }
48 // this ignores host names for self-generated certificates
49 String setDefaultHostnameVerifier = System.getProperty(RoboProtocol.paramSetDefaultHostnameVerifier);
50 if(setDefaultHostnameVerifier != null) {
51 HServerSocketFactoryHttpsHandling.setDefaultHostnameVerifier();
52 }
53 System.out.println("HServerSocketFactory " + connectionURL + ":" + acceptToken );
54 IServerSocket serverSocket = new HServerSocket(connectionURL, acceptToken);
55 return serverSocket;
56 }
57 }
58