Creating a TCP connection with SSL/TLS

Hi,
I am working in a application that depends on the server. I need to estabilish a TCP connection with SSL/Tls secure connection with the server in order to get the datas.
I have the following code structure :
- (id)initWithHostAddressNSString*)_host andPortint)_port
[self clean];
self.host = _host;
self.port = _port;
CFWriteStreamRef writeStream;
CFReadStreamRef readStream;
return self;
-(BOOL)connect
if ( self.host != nil )
// Bind read/write streams to a new socket
CFStreamCreatePairWithSocketToHost(kCFAllocatorDef ault, (CFStringRef)self.host, self.port, &readStream, &writeStream);
return [self setupSocketStreams];
- (BOOL)setupSocketStreams
// Make sure streams were created correctly
if ( readStream == nil || writeStream == nil )
[self close];
return NO;
// Create buffers ---- has not been released , so need to check possible ways to release in future
incomingDataBuffer = [[NSMutableData alloc] init];
outgoingDataBuffer = [[NSMutableData alloc] init];
// Indicate that we want socket to be closed whenever streams are closed
CFReadStreamSetProperty(readStream, kCFStreamPropertyShouldCloseNativeSocket, kCFBooleanTrue);
CFWriteStreamSetProperty(writeStream, kCFStreamPropertyShouldCloseNativeSocket, kCFBooleanTrue);
//Indicate that the connection needs to be done in secure manner
CFReadStreamSetProperty(readStream, kCFStreamPropertySocketSecurityLevel, kCFStreamSocketSecurityLevelNegotiatedSSL);
CFWriteStreamSetProperty(writeStream, kCFStreamPropertySocketSecurityLevel, kCFStreamSocketSecurityLevelNegotiatedSSL);
// We will be handling the following stream events
CFOptionFlags registeredEvents = kCFStreamEventOpenCompleted |
kCFStreamEventHasBytesAvailable | kCFStreamEventCanAcceptBytes |
kCFStreamEventEndEncountered | kCFStreamEventErrorOccurred;
// Setup stream context - reference to 'self' will be passed to stream event handling callbacks
CFStreamClientContext ctx = {0, self, NULL, NULL, NULL};
// Specify callbacks that will be handling stream events
BOOL doSupportAsync = CFReadStreamSetClient(readStream, registeredEvents, readStreamEventHandler, &ctx);
BOOL doSupportAsync1 = CFWriteStreamSetClient(writeStream, registeredEvents, writeStreamEventHandler, &ctx);
NSLog(@"does supported in Asynchrnous format? : %d :%d", doSupportAsync, doSupportAsync1);
// Schedule streams with current run loop
CFReadStreamScheduleWithRunLoop(readStream, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
CFWriteStreamScheduleWithRunLoop(writeStream, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
// Open both streams
if ( ! CFReadStreamOpen(readStream) || ! CFWriteStreamOpen(writeStream))
// close the connection
return NO;
return YES;
// call back method for reading
void readStreamEventHandler(CFReadStreamRef stream,CFStreamEventType eventType, void *info)
Connection* connection = (Connection*)info;
[connection readStreamHandleEvent:eventType];
// call back method for writing
void writeStreamEventHandler(CFWriteStreamRef stream, CFStreamEventType eventType, void *info)
Connection* connection = (Connection*)info;
[connection writeStreamHandleEvent:eventType];
`
As above, I have used
CFReadStreamSetProperty(readStream, kCFStreamPropertySocketSecurityLevel, kCFStreamSocketSecurityLevelSSLv3);
CFWriteStreamSetProperty(writeStream, kCFStreamPropertySocketSecurityLevel, kCFStreamSocketSecurityLevelSSLv3);
in order to make a secured connection using sockets.
The url i am using is in the format "ssl://some domain.com"
But in my call back method i am always getting only kCFStreamEventErrorOccurred for CFStreamEventType .
I also tried with the url "https://some domain.com" ,but getting the same error.
i also commented out setting kCFStreamPropertySocketSecurityLevel, but still i am receiving the same error that i mentioned above.
I dont know how it returns the same error. I have followed the api's and docs , but they mentioned the same way of creating a connection as i had given above.
I tried to get the error using the following code :
CFStreamError error = CFWriteStreamGetError(writeStream);
CFStreamErrorDomain errDomain = error.domain;
SInt32 errCode = error.error;
The value for errCode is 61 and errDomain is kCFStreamErrorDomainPOSIX. so i checked out the "errno.h", it specifies errCode as "Connection refused"
I need a help to fix this issue.
If the above code is not the right one,
**(i)how to create a TCP connection with SSL/TLS with the server.**
**(ii)How the url format should be(i.e its "ssl://" or "https://").**
**(iii)If my above code is correct where lies the error.**
I hope the server is working properly. Because I can able to communicate with the server and get the datas properly using BlackBerry and android phones. They have used SecuredConnection api's built in java. Their url format is "ssl://" and also using the same port number that i have used in my code.
Any help would be greatly appreciated.
Regards,
Mohammed Sadiq.

Hello Naxito. Welcome to the Apple Discussions!
Try the following ...
Perform a "factory default" reset of the AX
o (ref: http://docs.info.apple.com/article.html?artnum=108044)
Setup the AX
Connect to the AX's wireless network, and then, using the AirPort Admin Utility, try these settings:
AirPort tab
o Base Station Name: <whatever you wish or use the default>
o AirPort Network Name: <whatever you wish or use the default>
o Create a closed network (unchecked)
o Wireless Security: Not enabled
o Channel: Automatic
o Mode: 802.11b/g Compatible
Internet tab
o Connect Using: Ethernet
o Configure: Manually
o IP address: <Enter your college-provided IP address>
o Subnet mask: <Enter your college-provided subnet mask IP address>
o Router address: <Enter your college-provided router IP address>
o DNS servers: <Enter your college-provided DNS server(s)
o WAN Ethernet Port: Automatic
<b>Network tab
o Distribute IP addresses (checked)
o Share a single IP address (using DHCP & NAT) (enabled)

Similar Messages

  • TCP/IP with SSL

    I am facing problem in connecting to the server from my client
    (8.1.7) while using the TCP/IP with SSL Protocol.
    I am using the port 2484 port for the database as well for the
    listener. What might be the problem.
    It is saying no listener. What are the prerequisites that i need
    to follow in order to setup a connection using this protocol.
    Thanks in advance

    hi again,
    a little bit more detailed:
    1. copy all jar-files from jce/jsse-lib-path in .../JRE/ext/ (not SDK!)
    * jce1_2_1.jar
    * jcert.jar
    * jnet.jar
    * jsse.jar
    * local_policy.jar
    * sunjce_provider.jar
    * US_export_policy.jar
    2. include your security providers in .../JRE/lib/security/java.security
    security.provider.1=sun.security.provider.Sun
    security.provider.2=com.sun.net.ssl.internal.ssl.Provider
    security.provider.3=com.sun.rsajca.Provider
    security.provider.4=com.sun.crypto.provider.SunJCE
    cu
    oliver scorp

  • JDBC Thin Connections with SSL and client certificates

    Hi ,
    we are going have a look at JDBC Thin Connections with SSL and client certificates.
    I have two questions:
    1. Is it possible to use SSL connections from JDBC Thin Driver and which release of the driver introduced it
    2. Is it possible to use client certificates with JDBC Thin Driver and which release of the driver introduced it
    Thanks for your help
    regards
    Markus Reichert

    I could not reproduce the error after appending the SSL certificate to the certdb.txt file available under $Jinitiator_Home/lib/security folder.
    Steps to add the SSL Certificate:
    1. Run the form with the https mode in the IE Browser.
    2. Security Alert is raised.
    3. Click on the View Certificate button.
    4. In the Certificate Window, click on the Details tab.
    5. Click on the Copy to File button to copy the certificate.
    6. Copy the certificate and append to the certdb.txt file.

  • I can't set up gmail in my iPad 2. Keep on saying ' can't connect with SSL and ask me whether to connect without using SSL, then I press 'yes' and it said again IMAP is not working and tell me to see network connection and incoming mail server.

    I can't set up gmail in my iPad 2. Keep on saying ' can't connect with SSL and ask me whether to connect without using SSL, then I press 'yes' and it said again IMAP is not working and tell me to see network connection and incoming mail server. No idea how to do anymore. Already tried to figure out. But not work. Can anyone pls help me?

    Nope, doesn't pass verification. I get the spinner for a minute or so, then the alert about setting it up without SSL. Are you suggesting I disable Fetch and Push BEFORE I enter the account details? Because I never get past the account details screen, unless I choose "Set up without SSL" after the warning.

  • Connect to a printer via TCP connection with wifi

    Hi,
    what i would like to do, is to connect a printer to the iPhone via wireless.
    The printer is in the same wifi as the iPhone and the ip adress is known.
    So what i started to to is, to create a SocketConnection with CFStreamCreatePairWithSocketToHost(...). But if i switch of the printer, the inputstream is created too, and is not NULL as expected.
    Is this the right approach im using or is there a better possibilty to send strings to my printer using a tcp connection over wifi?
    Regards,
    Grinarn

    Welcome to Apple Discussions!
    In the Help menu of the Finder is a little app called Mac Help. Most Apple apps and many 3rd party apps also use Mac Help. In Mac Help is an article called *Adding a printer shared by a Windows computer via SMB/CIFS*. This article is regarding sharing a printer that is connected to a PC over a network however, and not to a router, but may have info useful to troubleshooting. You might also check with your Linksys user guide for info on sharing this printer with a Mac over the network.

  • How to create a data connection with dynamic XML file?

    Thanks for all reply first!
    I have formatted the submitted data into an XML file on the server side,this file can be import to PDF form correctly.
    I try to send this XML file to the user to let him can review what he has submitted.
    I guess that I should create a data connection to the XML file so that it can be reviewed by the user.
    But the question is that the XML file is dynamic generated.
    How can i do?
    give me some clus or examples,please.
    thanks,
    Jasper.

    Hi Jasper,
    To show user back the result, you can use PDF instead of XML. You can store the PDF template in server and you can merge XML data with PDF template by Livecycle Form Data Integration service.
    We, as KGC, can generate huge number of Adobe Livecycle forms in small periods. Also we give consultancy on Adobe Livecycle ES products and Adobe Livecyle Designer. In case of any need, do not hesitate to contact us.
    Asiye Günaydın
    Project Consultant
    KGC Consulting Co.
    www.kgc.com.tr

  • Solaris 10 DS5.2Q4 with SSL/TLS with Replicaton

    I have been working on configuring DS5.2Q4 on Solaris 10 11/06. I have been successful with Gary Tay's documentation (a few changes for new syntax and svcs). My current configuration only has one ldap server and using self signed certs.
    I would now like to move to the next step of maintaining my ssl/tls but adding another master with replication.
    Here are a couple of my questions.
    1) How do I configure my clients to work with both replication master servers. I am a little confused since the certs in my client are assigned to only one of my masters. Do both masters need the same cert, or is there a way to allow for both certs to be loated on the client (/var/ldap).
    2) Enable secure replication. I have not looked too deep into this yet, but that is my plan.
    As a final note, I would like to thank Gary Tay for all of his feedback and documentation. I find that Sun often lacks step by step procedures for tasks such as this. Thanks!

    I have been working on configuring DS5.2Q4 on Solaris 10 11/06. I have been successful with Gary Tay's documentation (a few changes for new syntax and svcs). My current configuration only has one ldap server and using self signed certs.
    I would now like to move to the next step of maintaining my ssl/tls but adding another master with replication.
    Here are a couple of my questions.
    1) How do I configure my clients to work with both replication master servers. I am a little confused since the certs in my client are assigned to only one of my masters. Do both masters need the same cert, or is there a way to allow for both certs to be loated on the client (/var/ldap).
    2) Enable secure replication. I have not looked too deep into this yet, but that is my plan.
    As a final note, I would like to thank Gary Tay for all of his feedback and documentation. I find that Sun often lacks step by step procedures for tasks such as this. Thanks!

  • Native Solaris 10 with DSEE 6.3.1 (or JSDS) with SSL (tls:simple)

    Hello There,
    I need some help from DSEE or LDAP experts.
    I am trying to configure DSEE 6.3.1 to use SSL(tls:simple).
    *{color:#0000ff}I have Simple(non-SSL) method working just fine and*
    **Also ldapsearch command works fine with simple and SSL methods*{color}**. So I know my certs are good but I just can not make ldap clien to work*
    *I followed this document [http://brandonhutchinson.com/wiki/Soup_To_Nuts_Sun_DSEE#Solaris_10_instructions]*
    I am using
    ldapclient -v init -a profileName=profile3 -a certificatePath=/var/ldap -a domainName=mydomain.com -a proxyDN="cn=proxyagent,ou=pro*file,dc=mydomain,dc=com" -a proxyPassword=XXXXX ldap200.mydomain.com*
    Here is the output
    +Parsing profileName=profile3+
    +Parsing certificatePath=/var/ldap+
    +Parsing domainName=mydomain.com+
    +Parsing proxyDN=cn=proxyagent,ou=profile,dc=mydomain,dc=com+
    +Parsing proxyPassword=xxxxx+
    +Arguments parsed:+
    +domainName: mydomain.com+
    +proxyDN: cn=proxyagent,ou=profile,dc=mydomain,dc=com+
    +profileName: profile3+
    +proxyPassword: xxxxx+
    +defaultServerList: ldap200.mydomain.com+
    +certificatePath: /var/ldap+
    +Handling init option+
    +About to configure machine by downloading a profile+
    +findBaseDN: begins+
    +findBaseDN: ldap not running+
    +findBaseDN: calling __ns_ldap_default_config()+
    +found 1 namingcontexts+
    +findBaseDN: __ns_ldap_list(NULL, "(&(objectclass=nisDomainObject)(nisdomain=mydomain.com))"+
    +rootDN[0] dc=mydomain,dc=com+
    +found baseDN dc=mydomain,dc=com for domain mydomain.com+
    +Proxy DN: cn=proxyagent,ou=profile,dc=mydomain,dc=com+
    +Proxy password: {NS1}67eb0f447bc0f619+
    +Credential level: 1+
    +Authentication method: 3+
    +About to modify this machines configuration by writing the files+
    +Stopping network services+
    +sendmail not running+
    +nscd not running+
    +autofs not running+
    +ldap not running+
    +nisd not running+
    +nis(yp) not running+
    +file_backup: stat(/etc/nsswitch.conf)=0+
    +file_backup: (/etc/nsswitch.conf -> /var/ldap/restore/nsswitch.conf)+
    +file_backup: stat(/etc/defaultdomain)=0+
    +file_backup: (/etc/defaultdomain -> /var/ldap/restore/defaultdomain)+
    +file_backup: stat(/var/nis/NIS_COLD_START)=-1+
    +file_backup: No /var/nis/NIS_COLD_START file.+
    +file_backup: nis domain is "mydomain.com"+
    +file_backup: stat(/var/yp/binding/mydomain.com)=-1+
    +file_backup: No /var/yp/binding/mydomain.com directory.+
    +file_backup: stat(/var/ldap/ldap_client_file)=-1+
    +file_backup: No /var/ldap/ldap_client_file file.+
    +Starting network services+
    +start: /usr/bin/domainname mydomain.com... success+
    +start: sleep 100000 microseconds+
    +start: sleep 200000 microseconds+
    +start: network/ldap/client:default... success+
    +restart: sleep 100000 microseconds+
    +restart: sleep 200000 microseconds+
    +restart: milestone/name-services:default... success+
    +System successfully configured+
    +When I run+
    *It takes long time and then*
    *+ldaplist: Object not found (Session error no available conn.+*
    *+)+*
    {color:#0000ff}The command logins also takes long time and does not show any LDAP users.{color}
    *+{color:#ff6600}Here is the output from cachemgr.log on client*+*
    *+{color}+*
    +Tue Jul 14 12:16:07.8984 Starting ldap_cachemgr, logfile /var/ldap/cachemgr.log+
    +Tue Jul 14 12:16:07.9391 sig_ok_to_exit(): parent exiting...+
    +Tue Jul 14 12:16:17.9511 getldap_set_refresh_ttl:(6) refresh ttl is 300 seconds+
    +Tue Jul 14 12:16:38.0741 getldap_set_refresh_ttl:(6) refresh ttl is 150 seconds+
    +Tue Jul 14 12:16:38.0755 Error: Unable to refresh profile:profile3:Session error no available conn.+
    +Tue Jul 14 12:16:38.0756 Error: Unable to update from profile+
    +{color:#ff6600}Here is the out from /var/adm/messages.+
    +{color:#000000}Jul 14 12:16:38 ldap300 ldap_cachemgr[19726]: [ID 293258 daemon.warning] libsldap: Status: 81 Mesg: openConnection: simple bind fai{color}+{color:#000000}+led - Can't contact LDAP server+
    +Jul 14 12:16:38 ldap300 ldap_cachemgr[19726]: [ID 292100 daemon.warning] libsldap: could not remove 192.168.190.146 from servers list+
    +Jul 14 12:16:38 ldap300 ldap_cachemgr[19726]: [ID 293258 daemon.warning] libsldap: Status: 7 Mesg: Session error no available conn.+
    +Jul 14 12:16:38 ldap300 ldap_cachemgr[19726]: [ID 186574 daemon.error] Error: Unable to refresh profile:profile3: Session error no available conn.+
    +Jul 14 12:16:38 ldap300 /usr/lib/nfs/nfsmapid[19731]: [ID 293258 daemon.warning] libsldap: Status: 81 Mesg: openConnection: simple+ +bind failed - Can't contact LDAP server+
    +Jul 14 12:16:38 ldap300 /usr/lib/nfs/nfsmapid[19731]: [ID 292100 daemon.warning] libsldap: could not remove 192.168.190.146 from servers list+
    +Jul 14 12:16:38 ldap300 /usr/lib/nfs/nfsmapid[19731]: [ID 293258 daemon.warning] libsldap: Status: 7 Mesg: Session error no avaible conn.+
    *ANY HELP IS GREATLY APPRECIATED*
    *THANKS*
    Edited by: PranavPatel on Jul 14, 2009 12:41 PM
    Edited by: PranavPatel on Jul 14, 2009 12:46 PM

    Here is the the profile from Server
    Non-editable attributes
    dn: cn=profile3,ou=profile,dc=mydomain,dc=com
    authenticationmethod: tls:simple
    bindtimelimit: 10
    cn: profile3
    credentiallevel: proxy
    defaultsearchbase: dc=mydomain,dc=com
    defaultsearchscope: one
    defaultserverlist: 192.168.190.146 192.168.11.221
    followreferrals: FALSE
    objectclass: top
    objectclass: DUAConfigProfile
    profilettl: 43200
    searchtimelimit: 30
    serviceauthenticationmethod: passwd-cmd:tls:simple
    serviceauthenticationmethod: keyserv:tls:simple
    serviceauthenticationmethod: pam_ldap:tls:simple
    Editable attributes:
    createtimestamp: 20090714180638Z
    creatorsname: cn=directory manager
    entrydn: cn=profile3,ou=profile,dc=mydomain,dc=com
    entryid: 26
    hassubordinates: FALSE
    modifiersname: cn=directory manager
    modifytimestamp: 20090714180638Z
    nsuniqueid: f37fa281-70a011de-80b5f403-069e0ba9
    numsubordinates: 0
    parentid: 13
    subschemasubentry: cn=schema
    And here is the output of
    *# ldapclient list*
    NS_LDAP_FILE_VERSION= 2.0
    NS_LDAP_BINDDN= cn=proxyagent,ou=profile,dc=mydomain,dc=com
    +NS_LDAP_BINDPASSWD= {NS1}67eb0f447bc0f619+
    NS_LDAP_SERVERS= 192.168.190.146, 192.168.11.221
    NS_LDAP_SEARCH_BASEDN= dc=mydomain,dc=com
    NS_LDAP_AUTH= tls:simple
    NS_LDAP_SEARCH_REF= FALSE
    NS_LDAP_SEARCH_SCOPE= one
    NS_LDAP_SEARCH_TIME= 30
    NS_LDAP_CACHETTL= 43200
    NS_LDAP_PROFILE= profile3
    NS_LDAP_CREDENTIAL_LEVEL= proxy
    NS_LDAP_BIND_TIME= 10
    NS_LDAP_SERVICE_AUTH_METHOD= pam_ldap:tls:simple
    NS_LDAP_SERVICE_AUTH_METHOD= keyserv:tls:simple
    NS_LDAP_SERVICE_AUTH_METHOD= passwd-cmd:tls:simple
    NS_LDAP_HOST_CERTPATH= /var/ldap
    Edited by: PranavPatel on Jul 14, 2009 1:08 PM

  • Automatically create ODBC DSN connection with powershell or GPO

    Hi,
    I'm trying to create a ODBC connection that has a special network port and also password automatically stored.
    I have tried to do this with the add-odbcdsn cmdlet and adding attributes to a group policy object configuration without luck.
    If I try to export settings with regedit and import them trough logonscript, the normal users dont have user rights to the LOCAL Machine hive.
    Therefore I have tried to export a USER DSN instead, but either of the port or password settings are exported.
    Please help.

    Hello,
    You can create a VB Script (.vbs) as the one create by Clamp77 on the following thread.
    http://stackoverflow.com/questions/23552529/can-i-create-a-bat-file-to-automate-data-sources-adding-in-odbc-data-source-adm
    Then you can run the script on computers using GPOs as explained on the following article.
    http://technet.microsoft.com/en-us/library/dn789196.aspx
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • Is it possible create a new connection with oracle database in javascript or formcalc?

    I need create a new connection, but it is necessary that I connect when the user click in a button.
    Is it possible?
    How can I do?
    Thanks
    Rubén

    How to connect ORACLE database to ADOBE LIFE CYCLE READER EXTENSION or ADOBE LIFE CYCLE DESIGNER

  • How to control tcp connection with java tcp socket programing ??

    Hi,
    I am connecting a server as using java socket programming.
    When server close the connection (socket object) as using close() method ,
    I can not detect this and My program continue sending data as if there is a connection with server.
    How to catch the closing connection ( socket ) with java socket programming.
    My Client program is as following :
    import java.io.PrintWriter;
    import java.net.Socket;
    public class client
      public client()
       * @param args
      public static void main(String[] args)
        Socket socket=null;
        PrintWriter pw=null;
        try
                          socket = new Socket("localhost",5555);
                          pw = new PrintWriter(socket.getOutputStream(),true);
                          int i=0;
                          while (true)
                            i++;
                            pw.println(i+". message is being send.");
                            Thread.sleep(5000);
        } catch (Exception ex)
                          ex.printStackTrace();
        } finally
                          try
                            if(pw!=null)pw.close();
                            if(socket!=null)socket.close();
                          } catch (Exception ex)
                            ex.printStackTrace();
                          } finally
    }

    I changed the code as following. But I couldn't catch the EOFException when I read from the socket. How can I catch this exception ?
    import java.io.BufferedReader;
    import java.io.EOFException;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.PrintWriter;
    import java.net.Socket;
    import java.net.UnknownHostException;
    public class client
      public client()
       * @param args
      public static void main(String[] args)
        Socket socket=null;
        PrintWriter pw=null;
        BufferedReader bufIn=null;
        InputStreamReader inRead=null;
        InputStream in=null;
        try
                          socket = new Socket("localhost",5555);
                          in = socket.getInputStream();
                          inRead = new InputStreamReader(in);
                          bufIn = new BufferedReader(inRead);
                          pw = new PrintWriter(socket.getOutputStream(),true);
                          int i=0;
                          while (true)
                            i++;
                            try
                              bufIn.readLine();
                              pw.println(i+". message is being send.");
                              System.out.println(i+". message has been send");
                            } catch (Exception ex2)
                              System.out.println(ex2.toString());
                              System.out.println(i+". message could not be send");
                            } finally
                            Thread.sleep(5000);
        } catch (EOFException ex)
                          ex.printStackTrace();
        } catch (InterruptedException ex)
                          ex.printStackTrace();
        } catch (IOException ex)
                          ex.printStackTrace();
        } finally
                          try
                            if(pw!=null)pw.close();
                            if(socket!=null)socket.close();
                          } catch (Exception ex)
                            ex.printStackTrace();
                          } finally
    }

  • Creating an IDE connection with OS Authentication

    I'm trying to set up an IDE connection using an ID that uses os authentication. Whenever I do, I get a message that I cannot leave the password blank.
    A google search showed that JDeveloper doesn't support OS Authentication. The message was old (by a few years), so I'm wondering if this is still true?
    Thanks,
    Chad

    Chad,
    I just tested in 11g update 2, and it appears that both username and password are required when creating an IDE connection.
    John

  • CFChart images broken when creating a PDF document with SSL

    I have a report that I create with Coldfusion, that includes a number of CFChart objects.  I recently installed a new SSL certificate, and now all the charts show up as broken links.   It shows up fine if I try and display this as HTML. On the chance it was something weird about my (lengthly) report, I created the following sample code that I saved in a file called foo.cfm:
    <cfset sDir = "C:/">
    <cfset filename = "foo123.pdf">
    <cfdocument format="pdf" filename="#filename#" overwrite="yes" marginleft=".7" margintop=".3" backgroundvisible="yes">
    TEST 12345
    <br>
    <br>
    <div style="height:500px;float:right; margin-left:10px; margin-top:10px; margin-right:10px; margin-bottom:10px;">
        <cfchart
            format="png"
            chartwidth="400"
            chartheight="360"
            showborder="no"
            databackgroundcolor="##ffffff" 
            fontbold="yes"
            sortxaxis="no"
            yoffset=".1"
            scaleto="100"
            showmarkers="no"
            show3d="no"
            fontsize="11"
              >
        <cfchartseries type="bar" datalabelstyle="none" seriescolor="##00CC99" paintstyle="shade">
        <cfchartdata item="B" value="40">
        <cfchartdata item="A" value="50">
        <cfchartdata item="E" value="80">
        <cfchartdata item="S" value="30">
        </cfchartseries>
        </cfchart>
    </div>
    </cfdocument>
    <cfoutput>
    <a href="#filename#" target="_blank">Foo</a>
    </cfoutput>
    If I go to the URL https://www.mywebsite.com/foo.cfm, the foo.pdf file shows a broken link.  If instead I go to http://www.mywebsite.com/foo.cfm the image of the chart shows up just fine. 
    The weird thing is that I have an older server running CF9.0.0.  On this server it works just fine.  On another server with 9.0.1, it breaks.  Same with 9.0.2, and CF 10. 
    I read something about needing to install the cert in a keystore, and I did this but it changed nothing.  The image is still broken in the pdf. 
    Any help would be greatly appreciated.  We have been able to work around the issue by posting the image in a non-secure location, but this seems like a hack, not a proper solution.

    Hi Anit, thanks for the feedback.  I did try this on a different server, using the instructions here:
    http://helpx.adobe.com/coldfusion/kb/import-certificates-certificate-stores-coldfusion.htm l
    and then restarted ColdFusion, but it didn't seem to fix the issue.  How would I check that the certificate has been correctly imported?  Also, how can I define what URL Coldfusion uses to get the images it creates with CFChart?   Though it seems to me this should "just work" by default, if I've followed the steps correctly, and I should have to edit any config files.

  • Automatically create ODBC DSN connection with special port and password. Add-OdbcDsn cmdlet

    Hi,
    I first posted a question in the SQL forum but I'm posting it here instead because its a Powershell question.
    In a non-persitent VDI enviroment we are trying to automatically create a ODBC DSN connection to a SQL server.
    We are using Windows 8.1 so we also have Powershell 4 together with the add-odbcdsn cmdlet. 
    But when trying to add set -SetPropertyValue for network port different than default and a password we get an error.
    here is the command:
    Add-OdbcDsn -Name test -DriverName "SQL Server" -DsnType User -SetPropertyValue @("PWD=test", "SERVER=10.0.0.1")
    and here is the error message:
    Add-OdbcDsn : Attempt to set the {UID or PWD} key of a DSN. These keys should not be stored in the registry for securit
    y reason. Provide the credential information at runtime via SQLDriverConnect, SQLConnect or SQLBrowseConnect.
    At line:1 char:1
    + Add-OdbcDsn -Name test -DriverName "SQL Server" -DsnType User -SetPropertyValue @ ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidArgument: (MSFT_OdbcDsnTask:Root/Microsoft/...SFT_OdbcDsnTask) [Add-OdbcDsn], Cim
    Exception
    + FullyQualifiedErrorId : MI RESULT 4,Add-OdbcDsn
    NB!:  this command does not contain a port number, but when adding it without a password(PWD string) we just the default port.

    Hi Primeid,
    Agree with Jrv, we cannot store  UID and PWD in an ODBC datasource, For example, you can create a DSN using the user interface but if you look at the DSN stored in the registry the UID and PWD are not stored.
    ODBC it is always required when you connect using a DSN that the caller supply UID and PWD if they want to use standard login during connection time. 
    These similar discussion are for your reference:
    Creating ODBC DSN for SQL Native
    Client fails for not-integrated authentication
    is user name and password required in ODBC admin / User DSN?
    In addition, to read data from a SQL Server database using an ODBC DSN with SQL Authentication via powershell, please refer to this script:
    Open SQL database with ODBC DSN and SQL AuthenticationIf
    there is anything else regarding this issue, please feel free to post back.
    If you have any feedback on our support, please click here.
    Best Regards,
    Anna Wang
    TechNet Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Howto setup an imap connection with ssl for incoming, but nonssl for outgo

    I am just stucked in a "simple" problem. Our mail-server is doing imap with a special configuration:
    - incomming is running imap/ssl on port 443
    - outgoing is running non-ssl (plain) on port 25
    The problem is that I can not set the "use ssl" and "port" configuration for incoming or outgoing separately. Or I assume I just can not find the way to setup this in the right way.
    Any hints on this?
    Carsten

    Hi. To set up you ssl incoming connection, open Preferences>Accounts. Click the Advanced tab, and near the bottom, you will see a place to enter the port number and check ssl enabled. For the outgoing connection, in the preference box, click Account Information. At the bottom you should see outgoing server information. Click on this and scroll to Edit Server List. Select the appropriate server (if you have more than one) and Click the Advanced tab. You should see a radio button that selects Standard ports (25 is among them).
    My account is set up exactly the same way without any problems.

Maybe you are looking for