Category: Uncategorized

  • How to make a single MKV from a Blu-ray

    Tools required:
    MakeMKV
    HandBrake (if you want to shrink the movie)
    AnyDVDHD (may be required for some Blu-rays)

    Guide
    In MakeMKV choose the Blu-ray drive (if MakeMKV can’t read the Blu-ray Disc then you might need to install AnyDVD HD and run in the background).

    Just choose the main movie, the biggest title, keep one audio track (I usually keep the AC3 DD audio track)

    Save it by click on Make MKV. You need a lot of HDD space, around 10-20GB. This will take around one hour or so. (if MakeMKV can’t read the Blu-ray Disc then you might need to install AnyDVD-HD and run in the background)

    You can now play the mkv using for example VLC Media Player, KMPlayer or MPC-HC. Or play using Windows Media player with ffdshow and haali media splitter installed.

    Shrink it
    If you want to shrink the video you can easily use HandBrake.
    In Handbrake load the mkv, Source->Video File.
    Set output file.
    Choose the High Profile->Film Preset (or use profiles for PS3, Xbox 360, etc)
    Set the desired output file size, Under Video->Target size, like 8100MB for a dual layer DVD-R or 4400MB for standard DVD-R.
    Start CONVERT…wait…wait…wait….sleep….wait…wait.

    Done.

    http://forum.videohelp.com/topic366744.html

  • How to Jailbreak and Unlock Your iPhone 3G, 3GS Using BlackSn0w [Windows]

    Step One
    Open your web browser of choice and navigate to http://www.blackra1n.com. Click the Windows logo at the bottom of the screen.

    Step Two
    When prompted save the download to your desktop

    (more…)

  • Internet Tethering on iPhone 3.0

    How to Activate and Enable Free Internet Tethering on iPhone 3.0

    1. Run Safari mobile web browser on the iPhone.
    2. Optional: If you want to generate your own mobileconfig with custom APN, username and password with Mobileconfig Generator, visit http://help.benm.at/help.php.

      In most case, just visit the next link directly, as the configuration files for most mobile carriers around the world have been prepared. If you’re following this link, click on Mobileconfigs.

    3. Visit the following Mobileconfigs website:

      http://help.benm.at/tethering.php

      Alternative: http://www.iphone-notes.de/mobileconfig/

    4. Select your country.
    5. Select your mobile service provider.
    6. Tap Install to install new profile.
    7. Select Install Now to download and install new profile.
    8. On iPhone interface, go to Settings -> General -> Network -> Internet Tethering.
    9. Set Internet Tethering to On.
    10. If prompted that Bluetooth is off, select Turn on Bluetooth or USB Only according to your preference.
    11. Internet tethering is enabled, connect iPhone to PC computer via USB or Bluetooth to start connecting to Internet though iPhone as tethered Internet gateway modem, with typical mobile broadband connection speed, normally up to around 1.4 Mbps. Meanwhile, iPhone will glow blue too.

       

      Note: Tethering computer through USB to iPhone to access Internet is much easier. Normally, Windows or Mac system will automatically recognize the tethered iPhone, and create require network connection to take advantage of the shared Internet access via iPhone. For Bluetooth connection, other than usual pairing, user also has to select “Connect to Network” from the Bluetooth device option in order to access the Internet from desktop or notebook/laptop computer via tethered iPhone.

    Actually, the hack can be performed manually by iPhone owner himself or herself. The profile download link above provides easiest and most convenient way to activate and enable Internet Tethering without hassle though. BenM.at is gathering all these publicly available information such as APN (access point name) and password for the iPhone for many network across the world, and create a XML based profile by using Apple’s iPhone Configuration Utility. The hosted iPhone tethering configuration profiles is pushed to the handsets of iPhone users who download the profile, and instant activates the tethering system free of charge.

    After downloading and installing the new Internet tethering enabled profile, some users may report MMS and/or VVM (Visual Voicemail) problem, where MMS or Visual Voicemail stops working. To fix the MMS and VVM not working after enabling Internet tethering error, go to Settings -> General -> Reset -> Reset Network Settings. After the short reset, iPhone should be able to be used for MMS, Voicemail and Internet tethering

    (http://www.mydigitallife.info/2009/06/28/activate-and-enable-iphone-as-internet-tethering-wireless-modem-without-hack-or-jailbreak/)

  • Web Content Protection

    I was asked  ”How do I monitor my kids internet usage” tada…

    http://www1.k9webprotection.com/index.php

    K9 Web Protection is our free Internet filtering and control solution for the home. K9 puts YOU in control of the Internet so you can protect your kids.

  • Decode a eval(gzinflate(base64_decode

    Just replace eval with echo and you get the code.

  • Solex 34 PICT/3 Carburetor

    Setting the 34PICT/3 Carburetor

    Note: The correct idle speed is important with the 34PICT/3 carburetor, which is more complicated (and more sensitive) than the earlier types. It has three separate fuel circuits in it (only two in older carburetors), and the 850-900 rpm idle is designed so the airflow through the carburetor is balanced for the idle circuit fuel flow. That’s why it has both Volume and Bypass screws in the side (the earlier ones had only Volume screws), located on the left side of the carburetor. This way the idle speed can be set correctly using the Bypass screw without touching the screw on the throttle arm, which has to be set exactly right.

    1. Make sure that all the hoses are in place and the gasket at the base of the carburetor is sealing properly (no vacuum leak).

    2. Install the air cleaner (the carburetor expects it to be there).

    3. Turn on the engine and run it until it is warm, then switch it off.

    4. The first step is to set the throttle plate. Back off the Fast Idle Adjuster (also called the throttle screw) located at the top of the throttle arm. You will find the throttle arm on the left side of the carburetor, connected at the bottom to the accelerator cable, which runs forward to the accelerator pedal.

    Note: Fast Idle Adjuster is a misnomer – this screw it is NOT used to adjust the idle speed. The Fast Idle Adjuster works with the choke to give a smooth idle on a cold engine. As the choke warms (in concert with the warming engine, hopefully) the butterfly valve in the throat of the carburetor opens and the Fast Idle Adjuster screw moves down the steps of the choke fast idle cam, reducing the engine idle speed. Screwing the Fast Idle Adjuster screw in more will increase the idle speed, but doing so messes up the Volume Control and Bypass Screw adjustments. This destroys the idle geometry, and the car won’t run right.

    5. With the choke held in the full open position (stepped cam at its lowest point), place a piece of notebook paper or a 0.003″ feeler gauge between the lowest step of the choke fast idle cam the the Fast Idle Adjuster screw.

    6. Slowly turn the screw in until you feel drag on the paper or the feeler gauge. Then remove the paper or feeler gauge and turn the screw in preciselly 1/2 turn – no more! This sets the throttle butterfly open the required 0.004″, so you can use the Bypass Screw (read on) to set the idle speed correctly. From this point on, leave the Fast Idle Adjuster screw alone.

    7. Next set the volume of gas available at idle speeds. This is done using the Volume Control Screw. Please note that the Volume Control Screw controls the AIR volume, not the fuel volume. Screwing it in reduces the air and makes the fuel/air mixture richer. And of course turning the Volume Control Screw out increases the concentration of air and makes the mixture leaner.

    Note: The Volume Control Screw is the smaller of the two adjusting screws, located on the left side of the carburetor just above the Idle Cutoff solenoid (which has a black wire from the positive side of the coil attached to it). The Volume Control Screw is NOT used to set the idle speed – that’s the job of the Bypass Screw.

    Note: Before setting the Volume Control Screw per the step below, turn the Bypass Screw (the larger one) out a couple of turns, just to get things started.

    8. Screw the Volume Control Screw in GENTLY until it bottoms out – you don’t want to open up the hole. Now unscrew it exactly 2-1/2 turns. This is the initial setting.

    Note: Though you want to be careful to not screw the Volume Control Screw in too far, you also want to make sure that it is initially firmly seated before unscrewing it as specified. If you don’t start with the Volume Control Screw firmly seated, you may have trouble adjusting the idle with the Bypass Screw, to the point where you may have it turned all the way in and still have the idle too high. This condition will cause stumbling on acceleration if not corrected.

    9. With the Volume Control Screw out 2-1/2 turns, start the engine and let it warm up. (Make sure the automatic choke is fully open.)

    10. Now to set the idle. This is done by controlling the volume of air going by the Bypass Screw. The Bypass Screw is larger than the Volume Control Screw and is located a little above and to the left of the Volume Screw.

    Note: Again, the idle speed is NOT set with the Fast Idle Adjuster on the top of the throttle arm as it is on the older 28 and 30 series carburetors – though its name (Fast Idle Adjuster) would lead you to think that its used to set the idle.

    11. As a starting point, turn the idle Bypass Screw whichever way (most likely out) to set the idle at 850 rpm (fast idle if you don’t have a tachometer). For a semi-automatic car, use 900 rpm. (It’s far better to have the idle speed too fast than too slow.)

    Note: See our Tune-Up Procedure for instructions on how to attach and use a dwell-tachometer.

    12. With the engine warmed up and the choke fully open, go back to the Volume Screw and adjust it slowly to obtain the fastest (smoothest running) idle speed (this is usually out – counter-clockwise). You should not turn the screw out much outside the range of 2-3 turns (1/2 turn in/out from the basic 2-1/2 turn out setting).

    13. Then turn the Volume Control screw back IN (clockwise) very slowly until the engine speed drops by about 20-30 rpm (slightly leaner). If you don’t have a tachometer, listen until you can just hear the engine speed start to drop, maybe as little as 1/8th turn on the Volume Screw.

    14. Go back to the larger Bypass screw again to reset the idle speed to 850 – 900rpm. (Again, the fast idle is better than too slow. You want it just a little on the rich side. Too slow of an idle speed can gause the engine to overheat.)

    (http://www.vw-resource.com/34pict3.html#points)

  • CutePDF Professional

    Make PDF booklets, impose (n-Up pages), combine PDF files, add watermarks, edit forms, add comments, add headers and footers, rearrange pages, security, digital signature, scan, FTP and much more. Seamlessly integrate with CutePDF Writer. Includes the Form Filler for Free!

    http://www.cutepdf.com/

  • CSS Hacks

    Syntax
    The syntax for conditional comments is as follows:

    Positive
    <!–[if condition]> HTML <![endif]–>
    Negative
    <!–[if !condition]><![IGNORE[–><![IGNORE[]]> HTML <!–<![endif]–>
    condition is one of the following:

    IE
    Any version of IE
    lt IE version
    Versions less than version
    lte IE version
    Versions less than or equal to version
    IE version
    Only version version
    gte IE version
    Versions greater than or equal to version
    gt IE version
    Versions greater than version
    version is the version of Internet Explorer, typically 5, 5.5, 6, or 7

    HTML is the HTML to be included if the condition does or doesn’t match, depending on the type of conditional comment. When included, the HTML is placed right where the conditional comment is in the source.

    For negative conditions, <![IGNORE[–><![IGNORE[]]> can be replaced with –> if the condition is simply IE. The longer version is only needed when Internet Explorer might parse the contents.

    The <![IGNORE[ … ]]> directive is not available in XML, so it is illegal to use it in XHTML. A solution would be to split it up into two special conditional comments: <!–[if !condition]> XHTML <![endif]–> <!–[if !IE]>–> XHTML <!–<![endif]–> where XHTML is the same both places. Note that Internet Explorer 7 and below don’t yet recognize XHTML as a form of XML, so this is merely forward-looking.

    Fixing stand-alone versions of Internet Explorer
    Internet Explorer was not designed to allow multiple versions to be installed at once, and Microsoft doesn’t officially support any such configurations. If you use one of the hacked third party packages that attempts to do this, you will experience problems with version-specific conditional comments, among other things. This is because the different stand-alone copies still rely on a common centralized registry for certain data, including version information.

    Although there is no simple way to cut through all of the issues with stand-alone versions of Internet Explorer, it is possible to force them to look elsewhere for their version information, thus fixing this issue with conditional comments. The trick is to remove the normal centralized version indicator. To do this, first open up regedit.exe from the “Run…” dialog. Navigate to HKEY_LOCAL_MACHINE/Software/Microsoft/Internet Explorer/Version Vector/ (If HKEY_LOCAL_MACHINE doesn’t exist, try HKLM instead). In the right pane, you should see a row with a Name value of IE. Rename this by clicking on it and changing it to zIE (or anything unique and different). Restart Internet Explorer to see the effects. Now when it looks for the IE key for its version information, the key will be missing and it will be forced to determine the correct version number from its own module.

    Stand-alone versions of Internet Explorer have a number of other issues, and it therefore may be better to instead use a separate virtual machine for each version of Internet Explorer to ensure that what you see is what your users will see. I recommend VMware Server, which is completely free of charge and fairly easy to set up.

    Conditional comments as a CSS hack
    Conditional comments can be used as a CSS hack by including links to stylesheets based on the layout engine. Here is an example of how stylesheets can be separated in this way:

    <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01//EN” “http://www.w3.org/TR/html4/strict.dtd”>
    <html lang=”en”>
    <head>
    <title>Test</title>
    <link href=”all_browsers.css” rel=”stylesheet” type=”text/css”>
    <!–[if IE]> <link href=”ie_only.css” rel=”stylesheet” type=”text/css”> <![endif]–>
    <!–[if lt IE 7]> <link href=”ie_6_and_below.css” rel=”stylesheet” type=”text/css”> <![endif]–>
    <!–[if !lt IE 7]><![IGNORE[–><![IGNORE[]]> <link href=”recent.css” rel=”stylesheet” type=”text/css”> <!–<![endif]–>
    <!–[if !IE]>–> <link href=”not_ie.css” rel=”stylesheet” type=”text/css”> <!–<![endif]–>
    </head>
    <body>
    <p>Test</p>
    </body>
    </html>

    http://www.javascriptkit.com/dhtmltutors/csshacks.shtml

  • android-wifi-tether made easy

    This program enables tethering (via wifi and bluetooth) for “rooted” handsets running android (such as the Android DevPhone 1). Clients (your laptop for example) can connect via wifi (ad-hoc mode) or bluetooth and get access to the internet using the 3G, 2G mobile connection or (in case you are using bluetooth) the wifi connection which is established by the handset.

    http://code.google.com/p/android-wifi-tether/

  • Apache SSL examples in htaccess files

    Any htaccess rewrite examples should always begin with

    Options +FollowSymLinks
    RewriteEngine On
    RewriteBase /
    

    Fixing double-login problem and making sure authorization usernames/passwords are not sent in cleartext unencrypted.

    Additional https/ssl information

    SSLOptions +StrictRequire
    SSLRequireSSL
    SSLRequire %{HTTP_HOST} eq "google.com"
    ErrorDocument 403 https://google.com
    

    This code is really, really nice because it fixes multiple issues with almost every other SSL redirect technique in htaccess files. (I discovered this one on my own)

    The problem with most techniques is REWRITING the URL.. so if you check the request to see if its being sent on port 443… guess what? in the interim it got sent! Most of the times the double login prompt error happens because users type in http://secureurl.com instead of https://secureurl.com. Most modern browsers automatically request the /favicon.ico file from the resource. In this case the resource is http instead of https like it should be.

    Now with some of the other techniques below you can solve this problem, but you will still face a potential ssl security issue. What if a user types in https://secureurl.com:80 There are a lot of these types of weird ways to bypass security so I recommend using the SSLRequireSSL option always.

    This will check to make sure that the connection IS using SSL, or it will fail. This works regardless of if your serving SSL on port 443, 80, 81, etc. This is the most secure setting for SSL logins.

    This also fixes having to type in the username and password twice by requiring the HTTP_HOST to match the HTTP_HOST that your SSL certificate is set-up for, in the case above, the SSL is for https://google.com not https://www.google.com

    If any of the required conditions are not met the server returns a 403 Forbidden Status Code (before mod_rewrite starts) and the ErrorDocument directive catches the 403 to send the visitor a Redirect to https://google.com

    Rewrite non-https requests to https without mod_ssl!

    Depending upon the HTTPS variable

    The HTTPS variable is always present, even if mod_ssl isn’t loaded!

    RewriteCond %{HTTPS} !=on
    RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
    

    Based upon the SERVER_PORT

    The SERVER_PORT variable is always present, and generally SSL runs on certain ports like 443.

    RewriteCond %{SERVER_PORT} !^443$
    RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
    

    Redirect everything served on port 80 to SSL

    RewriteCond %{SERVER_PORT} ^80$
    RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
    

    Redirect particular URLs to a secure version in an SSL SEO method

    RewriteRule ^/normal/secure(/.*) https://%{HTTP_HOST}$1 [R=301,L]
    

    Check to see whether the HTTPS environment variable is set

    RewriteCond %{HTTPS} !=on
    RewriteRule ^(/secure/.*) https://%{HTTP_HOST}$1 [R=301,L]
    

    Use the Redirect directive to cause a URL to be served as HTTPS

    Article: Redirect

    302 (temp) Redirect

    Redirect / https://google.com/
    

    SEO friendly 301 (permanent) redirect

    Redirect 301 / https://google.com/
    

    Changing to SSL or NON-SSL using relative URLs

    This lets you use hyperlinks of the form

    /document.html:SSL -- https://google.com/document.html
    /document.html:NOSSL -- http://google.com/document.html

    RewriteRule ^/(.*):SSL$   https://%{SERVER_NAME}/$1 [R,L]
    RewriteRule ^/(.*):NOSSL$ http://%{SERVER_NAME}/$1 [R,L]
    

    Custom Log Formats

    When mod_ssl is built into Apache or at least loaded (under DSO situation) additional functions exist for the Custom Log Format of mod_log_config. First there is an additional %{varname} extension format function which can be used to expand any variables provided by any module, especially those provided by mod_ssl which can you find in the above table.

    For backward compatibility there is additionally a special %{name} cryptography format function provided. Information about this function is provided in the Compatibility chapter.

    CustomLog logs/ssl_request_log   "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x "%r" %b"
    

    SSLEngine Directive

    • Description : SSL Engine Operation Switch
    • Syntax : SSLEngine on|off
    • Default : SSLEngine off
    • server config, virtual host

    This directive toggles the usage of the SSL/TLS Protocol Engine. This is usually used inside a section to enable SSL/TLS for a particular virtual host. By default the SSL/TLS Protocol Engine is disabled for both the main server and all configured virtual hosts.

    SSLEngine Example

    SSLEngine on
    

    SSLOptions Directive

    • Description : Configure various SSL engine run-time options
    • Syntax : SSLOptions [+|-]option …
    • server config, virtual host, directory, .htaccess

    This directive can be used to control various run-time options on a per-directory basis. Normally, if multiple SSLOptions could apply to a directory, then the most specific one is taken completely; the options are not merged. However if all the options on the SSLOptions directive are preceded by a plus (+) or minus (-) symbol, the options are merged. Any options preceded by a + are added to the options currently in force, and any options preceded by a – are removed from the options currently in force.

    Available options

    • StdEnvVars When this option is enabled, the standard set of SSL related CGI/SSI environment variables are created. This per default is disabled for performance reasons, because the information extraction step is a rather expensive operation. So one usually enables this option for CGI and SSI requests only.
    • CompatEnvVars When this option is enabled, additional CGI/SSI environment variables are created for backward compatibility to other Apache SSL solutions. Look in the Compatibility chapter for details on the particular variables generated.
    • ExportCertData When this option is enabled, additional CGI/SSI environment variables are created: SSL_SERVER_CERT, SSL_CLIENT_CERT and SSL_CLIENT_CERT_CHAINn (with n = 0,1,2,..). These contain the PEM-encoded X.509 Certificates of server and client for the current HTTPS connection and can be used by CGI scripts for deeper Certificate checking. Additionally all other certificates of the client certificate chain are provided, too. This bloats up the environment a little bit which is why you have to use this option to enable it on demand.
    • FakeBasicAuth When this option is enabled, the Subject Distinguished Name (DN) of the Client X509 Certificate is translated into a HTTP Basic Authorization username. This means that the standard Apache authentication methods can be used for access control. The user name is just the Subject of the Client’s X509 Certificate (can be determined by running OpenSSL’s openssl x509 command: openssl x509 -noout -subject -in certificate.crt). Note that no password is obtained from the user. Every entry in the user file needs this password: xxj31ZMTZzkVA, which is the DES-encrypted version of the word password”. Those who live under MD5-based encryption (for instance under FreeBSD or BSD/OS, etc.) should use the following MD5 hash of the same word: $1$OXLyS...$Owx8s2/m9/gfkcRVXzgoE/.
    • StrictRequire This forces forbidden access when SSLRequireSSL or SSLRequire successfully decided that access should be forbidden. Usually the default is that in the case where a Satisfy any directive is used, and other access restrictions are passed, denial of access due to SSLRequireSSL or SSLRequire is overridden (because that’s how the Apache Satisfy mechanism should work.) But for strict access restriction you can use SSLRequireSSL and/or SSLRequire in combination with an SSLOptions +StrictRequire. Then an additional Satisfy Any has no chance once mod_ssl has decided to deny access.
    • OptRenegotiate This enables optimized SSL connection renegotiation handling when SSL directives are used in per-directory context. By default a strict scheme is enabled where every per-directory reconfiguration of SSL parameters causes a full SSL renegotiation handshake. When this option is used mod_ssl tries to avoid unnecessary handshakes by doing more granular (but still safe) parameter checks. Nevertheless these granular checks sometimes maybe not what the user expects, so enable this on a per-directory basis only, please.

    SSLOptions Example

    SSLOptions +FakeBasicAuth -StrictRequire +StdEnvVars +CompatEnvVars -ExportCertData
    

    SSLRequire Directive

    • Description : Allow access only when an arbitrarily complex boolean expression is true
    • Syntax : SSLRequire expression
    • directory, .htaccess

    This directive specifies a general access requirement which has to be fulfilled in order to allow access. It’s a very powerful directive because the requirement specification is an arbitrarily complex boolean expression containing any number of access checks.

    This function takes one string argument and expands to the contents of the file. This is especially useful for matching this contents against a regular expression, etc. Notice that expression is first parsed into an internal machine representation and then evaluated in a second step. Actually, in Global and Per-Server Class context expression is parsed at startup time and at runtime only the machine representation is executed. For Per-Directory context this is different: here expression has to be parsed and immediately executed for every request.

    SSLRequire htaccess example

    SSLRequire (    %{SSL_CIPHER} !~ m/^(EXP|NULL)-/
                and %{SSL_CLIENT_S_DN_O} eq "Snake Oil, Ltd."
                and %{SSL_CLIENT_S_DN_OU} in {"Staff", "CA", "Dev"}
                and %{TIME_WDAY} >= 1 and %{TIME_WDAY} <= 5
                and %{TIME_HOUR} >= 8 and %{TIME_HOUR} <= 20       )
               or %{REMOTE_ADDR} =~ m/^192.76.162.[0-9]+$/
    

    SSLRequireSSL Directive

    • Description : Deny access when SSL is not used for the HTTP request
    • Syntax : SSLRequireSSL
    • directory, .htaccess

    This directive forbids access unless HTTP over SSL (i.e. HTTPS) is enabled for the current connection. This is very handy inside the SSL-enabled virtual host or directories for defending against configuration errors that expose stuff that should be protected. When this directive is present all requests are denied which are not using SSL. Example SSLRequireSSL

    SSLUserName Directive

    • Description : Variable name to determine user name
    • Syntax : SSLUserName varname
    • server config, directory, .htaccess

    This directive sets the “user” field in the Apache request object. This is used by lower modules to identify the user with a character string. In particular, this may cause the environment variable REMOTE_USER to be set. The varname can be any of the SSL environment variables.

    SSLUserName usage example

    SSLUserName SSL_CLIENT_S_DN_CN
    

    SSLVerifyClient Directive

    • Description : Type of Client Certificate verification
    • Syntax : SSLVerifyClient level
    • Default : SSLVerifyClient none
    • server config, virtual host, directory, .htaccess

    This directive sets the Certificate verification level for the Client Authentication. Notice that this directive can be used both in per-server and per-directory context. In per-server context it applies to the client authentication process used in the standard SSL handshake when a connection is established. In per-directory context it forces a SSL renegotation with the reconfigured client verification level after the HTTP request was read but before the HTTP response is sent.

    The following levels are available for level:

    • none : no client Certificate is required at all
    • optional : the client may present a valid Certificate
    • require : the client has to present a valid Certificate
    • optional_no_ca : the client may present a valid Certificate but it need not to be (successfully) verifiable.

    In practice only levels none and require are really interesting, because level optional doesn’t work with all browsers and level optional_no_ca is actually against the idea of authentication (but can be used to establish SSL test pages, etc.)

    SSLVerifyClient example

    SSLVerifyClient require
    

    SSLVerifyDepth Directive

    • Description : Maximum depth of CA Certificates in Client Certificate verification
    • Syntax : SSLVerifyDepth number
    • Default : SSLVerifyDepth 1
    • server config, virtual host, directory, .htaccess

    This directive sets how deeply mod_ssl should verify before deciding that the clients don’t have a valid certificate. Notice that this directive can be used both in per-server and per-directory context. In per-server context it applies to the client authentication process used in the standard SSL handshake when a connection is established. In per-directory context it forces a SSL renegotation with the reconfigured client verification depth after the HTTP request was read but before the HTTP response is sent. The depth actually is the maximum number of intermediate certificate issuers, i.e. the number of CA certificates which are max allowed to be followed while verifying the client certificate. A depth of 0 means that self-signed client certificates are accepted only, the default depth of 1 means the client certificate can be self-signed or has to be signed by a CA which is directly known to the server (i.e. the CA’s certificate is under SSLCACertificatePath), etc.

    SSLVerifyDepth example

    SSLVerifyDepth 10
    

    SSLCipherSuite Directive

    • Description: Cipher Suite available for negotiation in SSL handshake
    • Syntax : SSLCipherSuite cipher-spec
    • Default : SSLCipherSuite ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP
    • server config, virtual host, directory, .htaccess
    • Override: AuthConfig
    • Status: Extension

    This complex directive uses a colon-separated cipher-spec string consisting of OpenSSL cipher specifications to configure the Cipher Suite the client is permitted to negotiate in the SSL handshake phase. Notice that this directive can be used both in per-server and per-directory context. In per-server context it applies to the standard SSL handshake when a connection is established. In per-directory context it forces a SSL renegotation with the reconfigured Cipher Suite after the HTTP request was read but before the HTTP response is sent.

    Algorithms

    An SSL cipher specification in cipher-spec is composed of 4 major attributes plus a few extra minor ones
    • Key Exchange Algorithm: RSA or Diffie-Hellman variants.
    • Authentication Algorithm: RSA, Diffie-Hellman, DSS or none.
    • Cipher/Encryption Algorithm: DES, Triple-DES, RC4, RC2, IDEA or none.
    • MAC Digest Algorithm: MD5, SHA or SHA1.

    An SSL cipher can also be an export cipher and is either a SSLv2 or SSLv3/TLSv1 cipher (here TLSv1 is equivalent to SSLv3). To specify which ciphers to use, one can either specify all the Ciphers, one at a time, or use aliases to specify the preference and order for the ciphers.

    Key Exchange Algorithm
    • kRSA: RSA key exchange
    • kDHr: Diffie-Hellman key exchange with RSA key
    • kDHd: Diffie-Hellman key exchange with DSA key
    • kEDH: Ephemeral (temp.key) Diffie-Hellman key exchange (no cert)
    Authentication Algorithm
    • aNULL: No authentication
    • aRSA: RSA authentication
    • aDSS: DSS authentication
    • aDH: Diffie-Hellman authentication
    Cipher Encoding Algorithm
    • eNULL: No encoding
    • DES: DES encoding
    • 3DES: Triple-DES encoding
    • RC4: RC4 encoding
    • RC2: RC2 encoding
    • IDEA: IDEA encoding
    MAC Digest Algorithm
    • MD5: MD5 hash function
    • SHA1: SHA1 hash function
    • SHA: SHA hash function
    Aliases
    • SSLv2: all SSL version 2.0 ciphers
    • SSLv3: all SSL version 3.0 ciphers
    • TLSv1: all TLS version 1.0 ciphers
    • EXP: all export ciphers
    • EXPORT40: all 40-bit export ciphers only
    • EXPORT56: all 56-bit export ciphers only
    • LOW: all low strength ciphers (no export, single DES)
    • MEDIUM: all ciphers with 128 bit encryption
    • HIGH: all ciphers using Triple-DES
    • RSA: all ciphers using RSA key exchange
    • DH: all ciphers using Diffie-Hellman key exchange
    • EDH: all ciphers using Ephemeral Diffie-Hellman key exchange
    • ADH: all ciphers using Anonymous Diffie-Hellman key exchange
    • DSS: all ciphers using DSS authentication
    • NULL: all ciphers using no encryption

    Now where this becomes interesting is that these can be put together to specify the order and ciphers you wish to use. To speed this up there are also aliases (SSLv2, SSLv3, TLSv1, EXP, LOW, MEDIUM, HIGH) for certain groups of ciphers. These tags can be joined together with prefixes to form the cipher-spec.

    Available prefixes are
    • none: add cipher to list
    • +: add ciphers to list and pull them to current location in list
    • -: remove cipher from list (can be added later again)
    • !: kill cipher from list completely (can not be added later again)

    A simpler way to look at all of this is to use the openssl ciphers -v command which provides a nice way to successively create the correct cipher-spec string. The default cipher-spec string is ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP which means the following: first, remove from consideration any ciphers that do not authenticate, i.e. for SSL only the Anonymous Diffie-Hellman ciphers.

    Next, use ciphers using RC4 and RSA. Next include the high, medium and then the low security ciphers.

    Finally pull all SSLv2 and export ciphers to the end of the list.

    $ openssl ciphers -v 'ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP'
    NULL-SHA                SSLv3 Kx=RSA      Au=RSA  Enc=None      Mac=SHA1
    NULL-MD5                SSLv3 Kx=RSA      Au=RSA  Enc=None      Mac=MD5
    EDH-RSA-DES-CBC3-SHA    SSLv3 Kx=DH       Au=RSA  Enc=3DES(168) Mac=SHA1
    EXP-RC4-MD5             SSLv3 Kx=RSA(512) Au=RSA  Enc=RC4(40)   Mac=MD5  export
    EXP-RC2-CBC-MD5         SSLv2 Kx=RSA(512) Au=RSA  Enc=RC2(40)   Mac=MD5  export
    EXP-RC4-MD5             SSLv2 Kx=RSA(512) Au=RSA  Enc=RC4(40)   Mac=MD5  export
    

    SSLCipherSuite Example

    SSLCipherSuite RSA:!EXP:!NULL:+HIGH:+MEDIUM:-LOW
    

    mod_ssl Directives External Information

    1. SSLPassPhraseDialog
    2. SSLMutex
    3. SSLRandomSeed
    4. SSLSessionCache
    5. SSLSessionCacheTimeout
    6. SSLEngine
    7. SSLProtocol
    8. SSLCipherSuite
    9. SSLCertificateFile
    10. SSLCertificateKeyFile
    11. SSLCertificateChainFile
    12. SSLCACertificatePath
    13. SSLCACertificateFile
    14. SSLCARevocationPath
    15. SSLCARevocationFile
    16. SSLVerifyClient
    17. SSLVerifyDepth
    18. SSLLog
    19. SSLLogLevel
    20. SSLOptions
    21. SSLRequireSSL
    22. SSLRequire
    23. Additional Features
    24. Environment Variables
    25. Custom Log Formats

    Variables

    SSL Related Variables

    • HTTPS HTTPS is being used.
    • SSL_PROTOCOL The SSL protocol version (SSLv2, SSLv3, TLSv1)
    • SSL_SESSION_ID The hex-encoded SSL session id
    • SSL_CIPHER The cipher specification name
    • SSL_CIPHER_EXPORT true if cipher is an export cipher
    • SSL_CIPHER_USEKEYSIZE Number of cipher bits (actually used)
    • SSL_CIPHER_ALGKEYSIZE Number of cipher bits (possible)
    • SSL_VERSION_INTERFACE The mod_ssl program version
    • SSL_VERSION_LIBRARY The OpenSSL program version
    • SSL_CLIENT_M_VERSION The version of the client certificate
    • SSL_CLIENT_M_SERIAL The serial of the client certificate
    • SSL_CLIENT_S_DN Subject DN in client’s certificate
    • SSL_CLIENT_S_DN_x509 Component of client’s Subject DN
    • SSL_CLIENT_I_DN Issuer DN of client’s certificate
    • SSL_CLIENT_I_DN_x509 Component of client’s Issuer DN
    • SSL_CLIENT_V_START Validity of client’s certificate (start time)
    • SSL_CLIENT_V_END Validity of client’s certificate (end time)
    • SSL_CLIENT_A_SIG Algorithm used for the signature of client’s certificate
    • SSL_CLIENT_A_KEY Algorithm used for the public key of client’s certificate
    • SSL_CLIENT_CERT PEM-encoded client certificate
    • SSL_CLIENT_CERT_CHAINn PEM-encoded certificates in client certificate chain
    • SSL_CLIENT_VERIFY NONE, SUCCESS, GENEROUS or FAILED:reason
    • SSL_SERVER_M_VERSION The version of the server certificate
    • SSL_SERVER_M_SERIAL The serial of the server certificate
    • SSL_SERVER_S_DN Subject DN in server’s certificate
    • SSL_SERVER_S_DN_x509 Component of server’s Subject DN
    • SSL_SERVER_I_DN Issuer DN of server’s certificate
    • SSL_SERVER_I_DN_x509 Component of server’s Issuer DN
    • SSL_SERVER_V_START Validity of server’s certificate (start time)
    • SSL_SERVER_V_END Validity of server’s certificate (end time)
    • SSL_SERVER_A_SIG Algorithm used for the signature of server’s certificate
    • SSL_SERVER_A_KEY Algorithm used for the public key of server’s certificate
    • SSL_SERVER_CERT PEM-encoded server certificate

    Standard CGI/1.0 and Apache variables:

    HTTP_USER_AGENT        PATH_INFO             AUTH_TYPE
    HTTP_REFERER           QUERY_STRING          SERVER_SOFTWARE
    HTTP_COOKIE            REMOTE_HOST           API_VERSION
    HTTP_FORWARDED         REMOTE_IDENT          TIME_YEAR
    HTTP_HOST              IS_SUBREQ             TIME_MON
    HTTP_PROXY_CONNECTION  DOCUMENT_ROOT         TIME_DAY
    HTTP_ACCEPT            SERVER_ADMIN          TIME_HOUR
    HTTP:headername        SERVER_NAME           TIME_MIN
    THE_REQUEST            SERVER_PORT           TIME_SEC
    REQUEST_METHOD         SERVER_PROTOCOL       TIME_WDAY
    REQUEST_SCHEME         REMOTE_ADDR           TIME
    REQUEST_URI            REMOTE_USER           ENV:variablename REQUEST_FILENAME

    SSL-related variables:

    HTTPS                  SSL_CLIENT_M_VERSION   SSL_SERVER_M_VERSION
    SSL_CLIENT_M_SERIAL    SSL_SERVER_M_SERIAL
    SSL_PROTOCOL           SSL_CLIENT_V_START     SSL_SERVER_V_START
    SSL_SESSION_ID         SSL_CLIENT_V_END       SSL_SERVER_V_END
    SSL_CIPHER             SSL_CLIENT_S_DN        SSL_SERVER_S_DN
    SSL_CIPHER_EXPORT      SSL_CLIENT_S_DN_C      SSL_SERVER_S_DN_C
    SSL_CIPHER_ALGKEYSIZE  SSL_CLIENT_S_DN_ST     SSL_SERVER_S_DN_ST
    SSL_CIPHER_USEKEYSIZE  SSL_CLIENT_S_DN_L      SSL_SERVER_S_DN_L
    SSL_VERSION_LIBRARY    SSL_CLIENT_S_DN_O      SSL_SERVER_S_DN_O
    SSL_VERSION_INTERFACE  SSL_CLIENT_S_DN_OU     SSL_SERVER_S_DN_OU
    SSL_CLIENT_S_DN_CN     SSL_SERVER_S_DN_CN
    SSL_CLIENT_S_DN_T      SSL_SERVER_S_DN_T
    SSL_CLIENT_S_DN_I      SSL_SERVER_S_DN_I
    SSL_CLIENT_S_DN_G      SSL_SERVER_S_DN_G
    SSL_CLIENT_S_DN_S      SSL_SERVER_S_DN_S
    SSL_CLIENT_S_DN_D      SSL_SERVER_S_DN_D
    SSL_CLIENT_S_DN_UID    SSL_SERVER_S_DN_UID
    SSL_CLIENT_S_DN_Email  SSL_SERVER_S_DN_Email
    SSL_CLIENT_I_DN        SSL_SERVER_I_DN
    SSL_CLIENT_I_DN_C      SSL_SERVER_I_DN_C
    SSL_CLIENT_I_DN_ST     SSL_SERVER_I_DN_ST
    SSL_CLIENT_I_DN_L      SSL_SERVER_I_DN_L
    SSL_CLIENT_I_DN_O      SSL_SERVER_I_DN_O
    SSL_CLIENT_I_DN_OU     SSL_SERVER_I_DN_OU
    SSL_CLIENT_I_DN_CN     SSL_SERVER_I_DN_CN
    SSL_CLIENT_I_DN_T      SSL_SERVER_I_DN_T
    SSL_CLIENT_I_DN_I      SSL_SERVER_I_DN_I
    SSL_CLIENT_I_DN_G      SSL_SERVER_I_DN_G
    SSL_CLIENT_I_DN_S      SSL_SERVER_I_DN_S
    SSL_CLIENT_I_DN_D      SSL_SERVER_I_DN_D
    SSL_CLIENT_I_DN_UID    SSL_SERVER_I_DN_UID
    SSL_CLIENT_I_DN_Email  SSL_SERVER_I_DN_Email
    SSL_CLIENT_A_SIG       SSL_SERVER_A_SIG
    SSL_CLIENT_A_KEY       SSL_SERVER_A_KEY
    SSL_CLIENT_CERT        SSL_SERVER_CERT
    
    
    
    
    http://www.askapache.com/htaccess/apache-ssl-in-htaccess-examples.html
    SSL_CLIENT_CERT_CHAINn SSL_CLIENT_VERIFY